Configuring API callback
When you enable API callback in Automation, after the API action makes a call to the defined API, the workflow pauses and waits for the external service to call back to Automation. If Automation receives a response with a status value of success, the workflow proceeds to the next step.
Prerequisites
You must configure your API server to support API callback. Otherwise, the action will fail and
your workflow will fail. The server must include these elements when it responds to Automation:
- Automation’s static URL (the callback endpoint): https://api.ibmaspera.com/automation/v1/external/api_callback
- The token from Automation (which it can parse from the payload sent in step 1, below).
Enabling API callback in the UI
To use API callback, go the Automation Workflows page:
- Create or open a workflow and select the Call an API action.
- Select a Request type of POST or PUT.
- Check the box labeled Add an API callback.
- Configure the rest of the fields as needed, then click Save.
- Activate the workflow.
Sequence of events
If you enable callback for an API action, the following things happen automatically when the
action is triggered:
- Your workflow sends the JSON payload to the API you defined for the action. Automation inserts a
required token (a unique identifier) in the payload, by default. At this point, the workflow pauses
to wait for a response. Note: When you enable the callback feature, the default timeout value—the maximum time the action can take before it is marked as failed—changes from 5 minutes to 24 hours.
- (Optional) The external service may send status notifications to the callback endpoint. These responses contain a status field with a value of in progress and a progress field with a value between 0-100. The data is displayed in the Automation UI, on the Workflows page.
- When the service completes its process, it returns a JSON response to the callback endpoint. The payload must include the unique identifier token from Automation and a status of success or failed.
- If the status is success, the workflow proceeds to the next step.