The callback mechanism allows a process to offload part of its execution to run in the background while maintaining control over its progress and outcome. It provides a structured way for background work to report status updates – such as started, in progress, completed, or error – back to the original process. This is useful for long-running or external tasks that should not block the main flow but need to inform it when they're done or if something goes wrong.
To use the mechanism, the process first creates a callback, which generates a token and registers an anchor step to receive updates. That token is passed into the background execution, which can then send updates back by calling the anchor step with a status and optional data. The anchor step determines what to do next – such as proceeding with the next action, handling errors, or storing intermediate results – based on the reported status.
Callbacks do not create or manage the background process itself. They do not start or stop the process – they simply allow it to notify the caller of progress or results. This keeps the responsibility for process execution with the background task, while giving the main process a clear and manageable way to respond as those tasks complete.
Callback provides support for callbacks. It is used with Call which can run processes in the background.
- Concepts
- Callback step type modes of operation
- Create a callback
- Start and complete background execution
- Passing parameters to background executions and returning responses
- Monitoring background execution
- Returning progress and intermediate results
- Handling errors
- Cancelling a background execution
- Handling timeouts
- Waiting for completion
- Managing remote background executions
- Callback processing - advanced