Post-request script
Introduction
Typically, a process flow run is triggered and a request for data is made via a connector shape - if the request is successful, data is retrieved and the flow continues.
However, there may be scenarios where you need to control whether the connector shape or process flow run should fail or continue based on information returned from the connection request. To achieve this you can apply a post-request script to your endpoint.
Usage
When a post-request script is added to an endpoint, it is applied wherever that endpoint is used in process flows.
If your post-request script should only be applied to specific flows, we recommend applying it as a response script for the connector shape in required flows. For more information please see: Using connector shape response scripts.
About post-request scripts
A post-request script receives the response code, headers, and body from connection requests and - utilising response_code actions - returns a value determining whether the connector shape/flow run continues or stops.
Creating post-request scripts
Post-request scripts are written and deployed in the usual way, via the custom scripts option. However, two additional options can be used: response_code and message. For more information about working with these options, please see: Using connector shape response scripts.
If a connector shape is configured for an endpoint associated with a post-request script AND a response script is applied in connector shape settings, the connector shape takes precedence. In this scenario, the response script applied in the connector shape is used and the post-request script applied to the endpoint is ignored.
Applying a post-request script to an endpoint
Step 1
Select the post-request script tab for your endpoint:

Step 2
Click in the select a script field and choose the script that you want to use - for example:

Step 3 Choose the script version that you want to use:

If your script is updated in future, remember to come back here and (if appropriate) select the later version.
Step 4
Review the script code to be applied, then click the save and go back button:

Last updated
Was this helpful?