Events and schedules
Use an automation to start agent tasks from Pulumi operations, webhooks, or a schedule.
In Pulumi Cloud, open Agents, then Automations. For a TypeScript example, see Define the agent and its trigger. Creating an automation requires agent_automations:create and access to the selected agent. New automations belong to the organization; automation permissions control access to their tasks.
Each automation has a Name, an Agent to run, and a Prompt describing what the agent should do. Each task also uses the agent's saved instructions and integrations. To configure a trigger while creating an agent, see Choose how the agent starts.
Connect a Pulumi operation
In Automations, select Set up trigger and enter the name, agent, and prompt:
- Set Runs to When a Pulumi operation completes.
- Select the Operations, Results, and Stacks that should start tasks.
- Select Create automation.
Supported operations include update, preview, refresh, destroy, import, rename, drift detection, and drift remediation. Results can be Failed, Succeeded, or Canceled. Only operations recorded in Pulumi Cloud can trigger tasks.
Select individual stacks in Stacks; prompts and stack tags do not filter events. Pulumi adds matching stacks to the task as context.
The first matching event starts a task. Follow-up batch window (seconds) controls how long later events can join that task instead of starting another. The default is 30 seconds after the most recent event, with a maximum of one hour after the first event. Once that window closes, the next matching event starts a new task. Events from different stacks can join the same task.
Events are delivered without waiting for the window to close. Events received while the agent is busy are combined for its next turn. This batching also applies to webhooks.
Connect an external webhook
In Automations, select Set up trigger and enter the name, agent, and prompt:
- Set Runs to When a webhook event arrives.
- Under Webhook preset, select Generic webhook, PagerDuty, Honeycomb, Sentry, or Datadog.
- Select Create automation. Keep the setup panel open for the webhook URL, secret, and connection instructions.
- Configure the sender to use that URL and include
X-Pulumi-Trigger-Secretwith the displayed secret value on every request.
The Pulumi secret is shown once. Save it before closing the panel. If you lose it, rotate it from the automation details page.
Webhooks supply event data. To let the agent query the source for more information, also connect its integration.
For provider-specific setup, follow PagerDuty, Honeycomb, Sentry, or Datadog.
Test a webhook
Send a test notification using the provider guide. Test deliveries can run the agent.
For a Generic webhook, replace the placeholders and send a JSON request:
curl --request POST '<webhook-url>' \
--header 'Content-Type: application/json' \
--header 'X-Pulumi-Trigger-Secret: <pulumi-secret>' \
--header 'Idempotency-Key: checkout-alert-001' \
--data '{"service":"checkout","summary":"Error rate above 5% for 10 minutes"}'Use a unique Idempotency-Key for each event and reuse it when retrying that event. Without a key, identical payloads are treated as duplicate deliveries.
A successful webhook request returns HTTP 202. Check Last delivery and All runs on the automation. Events can join an existing task through batching; duplicate deliveries are ignored.
For failed deliveries, check the URL, Pulumi header, and any provider signing credential. Rotating the Pulumi secret invalidates the old value immediately; update the sender's header before retrying.
Schedule recurring work
In Automations, select New automation, then Start with a blank automation. Enter the name, agent, and prompt:
- Set Runs to On a schedule.
- Set Frequency to hourly, daily, weekdays, weekly, or a custom cron expression. Preset times use your browser's local time zone; custom cron expressions use UTC.
- Select Create automation.
Stop future runs
Select Pause in the automation's actions menu to stop future runs, or Resume to restart them. Cancel running tasks separately. To stop all triggers and schedules for an agent, pause the agent.