Correlate and validate callbacks
Generate an unpredictable or otherwise protected token tied to the specific execution and expected callback type. Validate source, signature, and payload before advancing the workflow, and avoid putting sensitive data in a callback URL.
Make callback handling idempotent so duplicate deliveries return the prior outcome rather than repeating side effects. Confirm how the workflow treats concurrent callbacks for the same execution.
Define timeout and recovery behavior
Choose how long the step may wait and what happens on expiry: retry the external request, mark the execution for review, or end it with a clear failure. Keep the timeout aligned with the external service’s expected completion window.
Record callback receipt, validation result, and execution state without logging secrets. Test valid, duplicate, malformed, late, and missing callbacks, including recovery after the workflow service restarts.