Setup a callback to your server when a task finishes running
callback_url
argument to your function decorator, Beam will make a POST request to your server whenever a task finishes running. Callbacks fire for both successful and failed tasks.
Callbacks include the Beam Task ID in the request headers, and the task response URL-encoded in the request body.
data
field:
x-task-timestamp
— timestamp the task was created.x-task-signature
— signature to verify that the request was sent from Beam.x-task-status
— status of the task.x-task-id
— the task ID.callback_url
for each request, for example if you have different environments for staging and prod.
You can pass callback_url
as a payload to anything you’re running on Beam, and we’ll use that as the callback for the request:
callback_url
value or kwargs (**inputs
) as input to the handler function:Settings
-> General
page.
x-task-signature
.
x-task-signature
is a unique signature generated by converting the request body to base64, concatenating it with the timestamp, and signing it with your Beam API token.
The code below shows how to validate a callback signature: