Task Reference
compute_hash
Compute a stable content hash per record so downstream sync steps can detect changes between runs.
compute_hash
Computes a hash of the input record and adds it as a field, for change detection between runs.
When to use it
Use compute_hash with get_destination_id and a skip_if comparison to update only records whose content changed. For new tasks, prefer sync_record, which computes and compares the hash internally as part of one composite step.
Configuration
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
fields |
string[] | No | all fields not prefixed with _ |
Field names to include in the hash. |
algorithm |
string | No | sha256 |
Hash algorithm: sha256 or md5. |
field_name |
string | No | _hash |
Name of the output field the hash is written to. |
An invalid algorithm fails validation with Invalid hash algorithm: '<value>' (must be sha256, md5); a non-string-array fields fails with compute_hash fields must be an array of strings.
Example
name: hash-contacts
connectors:
source:
type: csv
steps:
- name: read_contacts
type: call_method
config:
connector: source
method: read
args:
resource: contacts
- name: hash
type: compute_hash
config:
fields: ["name", "email", "updated_at"]Behavior notes
- The output is the input record plus the hash field — by default
_hash, or the name set infield_name. No other fields change. - Requires an object input. A non-object item fails the step with
Compute hash requires an object input. - When
fieldsis omitted, every field whose name does not start with_participates in the hash, so previously added bookkeeping fields (like_hashitself) are excluded. - Downstream steps that compare hashes must use the same
fieldslist andalgorithm, or every record looks changed.
Related
- sync_record — computes, compares, and stores the hash in one step
- get_destination_id — returns the previously stored hash to compare against
- Idempotent sync and the mapping DB — the change-detection pattern end to end