Parameters object
Optionalheaders?: Record<string, string>Headers for the request
Optionalpayload?: objectRequest payload
Request URL
Resolves with the payload received by the webhook
const finalPayload = {
workflowId,
payload
}
After dispatching the request, the workflow pauses and waits for a POST to /workflow/:id/feedback (where :id is the workflowId). When the API receives that request, its body is delivered back to the workflow and execution resumes.
const response = await sendPostRequestAndAwaitWebhook( {
url: 'https://example.com/integration',
payload: {
}
} );
assert( response, 'the value sent back via the api' );
Send an POST HTTP request to a URL, optionally with a payload, then wait for a webhook response.
The "Content-Type" is inferred from the payload type and can be overridden via the
headersargument.If the body is not a type natively accepted by the Fetch API, it is serialized to a string:
JSON.stringify()for objects, orString()for primitives.When a body is sent, the payload is wrapped together with the
workflowIdand sent as: