Skip to main content
workflows emit events as they run. An integration carries those events to somewhere you watch — an HTTP endpoint you own, or a Slack channel. Use integrations instead of polling when executions are long or volume is high. Use them when a person must know that a unattended execution failed.

How events reach you

Integrations work in two layers.
  1. The integration. You create it once for the organisation. It holds the connection — the webhook URL, or the authorised Slack workspace.
  2. The notification. You attach the integration to a workflow, and choose which events fire it.
One integration can serve many workflows. One workflow can carry several notifications with different rules.

Set up a webhook

1

Create the integration

Go to IntegrationsAdd IntegrationWebhook, then set:
  • URL — the endpoint that receives the events.
  • Headers — optional headers Asteroid adds to every request.
Asteroid always sends POST with a JSON body.
2

Attach it to a workflow

Open the workflow, go to the Notifications tab, and select Add Notification. Then configure:
  • Event rules — which event types fire the notification.
  • Field filters — match on fields inside the payload.
  • Metadata filter — fire only when the execution’s metadata matches.
  • Unwrap result — for EXECUTION_COMPLETED, send payload.result alone instead of the full envelope.
3

Verify the signature

Check X-Asteroid-Signature against the raw request body before you parse or act on anything. See Verify the signature.

Payload structure

Every request body has the same shape, unless Unwrap result is set on an EXECUTION_COMPLETED rule. That delivery carries the result object on its own.
string
required
The category of the notification. execution is the only value.
string
required
Identifier for this delivery.
string
required
ISO 8601 timestamp of the event.
object
required
The execution context and the event-specific payload.
info holds:
string
required
The event name. See Event types.
string
required
Execution UUID.
string
required
Link to the execution in the platform. For batch events it points at the workflow’s batch page.
string
required
workflow UUID.
string
required
workflow display name.
object
The metadata you attached when you started the execution.
object
required
Event-specific data. Its shape depends on info.event.

Event types

Match on info.event. The rule picker in the platform lists the same events by name.

Execution lifecycle

EXECUTION_CANCELLED carries the cancel reason. See Debug your workflows for what each reason means.

Actions and steps

Execution detail

Batches and tests

See Batch executions.

Example: a failed action


Verify the signature

Asteroid signs every body:
  • SHA-256 digest of the raw body bytes.
  • RSA PKCS#1 v1.5 signature.
  • Base64, in the X-Asteroid-Signature header.
Use the webhook verification public key for your workspace. Fetch it from GET /integrations/webhook/public-key, and cache it against the keyId that call returns. Refetch when the keyId changes, so a rotated key does not start rejecting valid deliveries.
Verify against the raw request bytes, before you parse the JSON. Any reserialisation changes the bytes and breaks the check.

Filter what you receive

Most teams want the failures, not the running commentary.

Subscription modes

Field filters

Add one or more field filters to an event type. Filters on one event type combine with OR: the notification fires when any of them match. Two filters — outcome equals failure and outcome equals cancelled — mean “tell me when the outcome is either one”.

Metadata filters

A metadata filter matches the key-value pairs you attached when you started the execution. All pairs must match, so the filter combines with AND. Leave the metadata filter empty and the notification fires for every execution. Metadata filtering runs after event-type filtering. An execution must match the event rules first, then the metadata filter.
Attach metadata on every execute call and one workflow can feed several channels. Send production failures to your on-call channel, and staging failures nowhere. See Call a workflow from your code.

A worked example

One workflow, two environments, two webhooks. A production failure fires the first. A staging failure fires the second. A staging run that completes fires neither.

Slack

The Slack integration posts the same events into a channel, formatted for people to read.

Install it

You need a Slack workspace where you can install apps.
1

Add the integration

In the platform, go to IntegrationsAdd IntegrationSlack. Slack asks you to authorise the app. Review the permissions, pick the workspace, and select Allow.
2

Set the default channel

Find the new Slack integration in the list and open its Edit dialog. Pick a Default Channel and save. The Asteroid bot joins the channel you pick.
The dropdown lists public channels. To use a private channel, invite the Asteroid bot to it in Slack first. The channel then appears in the dropdown, after you refresh the page.
3

Attach it to a workflow

Open the workflow, go to the Notifications tab, and select Add Notification. Pick the Slack integration, set the event rules, and save.

What a Slack message contains

  • Status — a colour and an icon for the event type.
  • Context — the workflow name, and a link to the execution in the platform.
  • Detail — depends on the event:
    • EXECUTION_COMPLETED — a snippet of the result and the workflow’s reasoning.
    • EXECUTION_FAILED — the error and the reason.
    • EXECUTION_PAUSED — the reason, such as the question the workflow asked.
Some messages carry a button. A human-in-the-loop request lets you open the execution straight from Slack.

Test the integration

Select Test integration in the platform. Asteroid sends an EXECUTION_TEST payload.
Point a new webhook at webhook.site for the first smoke test. Then move to your real endpoint with signature verification switched on.

Build a reliable endpoint

Return 2xx as soon as you have the body. Do the work afterwards, in your own queue. A slow endpoint turns into a failed delivery.
Delivery is at-least-once. Build your handler so a repeat is harmless.Dedupe on your own business identifiers. event_id is generated per delivery and changes across retries, so it cannot carry the whole job.
Asteroid makes up to three send attempts, with a short backoff, before it marks a delivery failed.
Run a periodic sweep with GET /executions alongside your webhook handler. It catches anything that arrived while your endpoint was down. See Executions and statuses.
Log info.event, info.execution_id, info.agent_id, and your own outcome. That is enough to reconstruct any delivery later.

Troubleshooting

  • Check the endpoint is reachable from the internet and accepts POST.
  • Check the notification’s event rules cover the events you expect.
  • Check the metadata filter values match the execution’s metadata exactly.
  • Verify against the raw request bytes, not parsed JSON.
  • Use RSA PKCS#1 v1.5 with SHA-256.
  • Check you have the public key for the right workspace.
  • Handle at-least-once delivery in your own logic.
  • Dedupe on stable execution fields, not on event_id alone.
  • Return 2xx once you recognise a duplicate.
  • Check the integration has a default channel.
  • For a private channel, invite the Asteroid bot in Slack first.
  • Check the integration is attached to the workflow on its Notifications tab.

Next

Call a workflow from your code

Attach the metadata your filters match on

Batch executions

Batch events and why webhooks beat polling

Executions and statuses

The statuses behind each event

Debug your workflows

What to do when an event says the execution failed