Validate data before sending: Check required fields, types and nulls against the destination API; Test with real failure cases like invalid dates and unknown IDs; Fail visibly—log errors and route records to an exception queue
Image: Workflow Automation Guide

Error Handling

Part of Workflow data mapping

Validating transformed data before sending it onward

A workflow can transform a payload successfully and still send the wrong business value.

A workflow can transform a payload successfully and still send the wrong business value. Validate the result at the boundary to the receiving system, after the mapping has run and before it creates or changes a record. There, format, requiredness and meaning can be checked together.

Check the destination contract

Validate required fields, data types, allowed values and permitted nulls against the destination API. If the workflow builds JSON, a schema can detect a missing property or wrong type. It cannot decide whether a correctly formatted customer ID belongs to the right customer. Add business rules for identity, currency, status and date meaning where errors would affect the receiving process.

Keep the validation close to the outbound action. A source payload may be valid at entry, but a mapping step can drop a field, convert a number to text or overwrite a value with a default. Validate the exact payload being sent, not only the original trigger data.

Use representative failure cases

Prepare a standard record and cases with an absent optional field, explicit null, unsupported status, malformed date, unknown identifier and duplicate event. For a hypothetical order-to-fulfilment workflow, the order may parse correctly but contain a shipping method the fulfilment system does not recognise. Hold such a record for mapping review; do not silently replace the method with a convenient option.

Check the transformed output against expected values in a test environment. Then send it to a disposable destination record and inspect the resulting state. A successful HTTP response does not prove the intended business change occurred. Include a retry case if the workflow may repeat after a timeout.

Handle rejection visibly

When validation fails, record the event ID, field, rule and safe diagnostic detail. Send the record to an exception queue or owner with a defined route for correction. Avoid logging secrets or full personal data payloads simply for convenience. Make sure a failure in one record does not falsely mark the whole batch as complete.

Maintain the validation rules with the mapping contract. If the destination changes an enum or makes a field conditionally required, update and test the rules before the next release. Validation is useful only when its failure changes what the workflow does.

More from Error Handling