source; the context object carries the event data.
Before you start
Use an API key and workspace identifier, and identify the project that owns the automation. Use the variables and language setup from the quickstart, withPROJECT_ID set to that project’s ID.
Configure the automation
Requires you to act: In your project, open Agent → Automations → New automation and configure the trigger:- Give the automation a descriptive Name, such as Review test results.
- Set Trigger to When a custom webhook is called.
- Set Webhook name to
test-results-ready.
endpoint, github, or schedule. If multiple automations in the project share the same source, one request can start them all.
Requires you to act: Define the work and save the automation:
- In Agent → Instructions, describe the expected input and the actions to take. For example: “Read the test report URL from context.report_url. Summarize failed tests and identify affected requirements. Return a concise summary without changing project data.”
- Select Create.
Send an event
Send an authenticatedPOST /ai/trigger request with the webhook name, project ID, and JSON context. Replace the sample report URL with one the automation can access. The event_id below is your correlation value; including it does not make repeated requests idempotent.
202 means the request was accepted, not that the work has finished. Store each agent_id from results and poll for completion. An empty results array means no runs matched; check the saved webhook name and project ID.
Connect your event sender
Your sender must authenticate to Flow and produce the request body above. If an external service cannot set the required headers or transform its event intosource and context, use a server-side handler that validates the incoming event and calls Flow with your API key.
Keep credentials in the sender’s secret storage. Record the sender’s event ID alongside the returned run IDs so you can trace deliveries and suppress duplicates before triggering Flow. After a network timeout, check for an existing run before resending: the first request can still be executing.
For apps already connected through Flow’s Integrations, use the corresponding app trigger. This custom webhook guide covers events you send through the customer API.
Next steps
- Trigger and poll automations for run statuses and retry behavior.
- Trigger from any source for the complete request schema.
- Poll automation runs for the result schema.