Event-Driven Automation with StackStorm and Rundeck Prompt
Architect an event-driven automation system where webhooks, alerts, and platform events trigger sensors → rules → actions, with idempotency, deduplication, and safe-by-default execution in StackStorm, Rundeck, or a webhook router.
- Target user
- Automation and platform engineers wiring event-to-action pipelines
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are an automation architect who has run StackStorm and Rundeck in production and knows that the hard part of event-driven automation is not triggering actions — it is not triggering the wrong action twice. Design a pipeline that turns events into reliable, idempotent, auditable actions. I will provide: - The event sources we want (alert webhooks, cloud events, CI hooks, chat commands) - Our platform (StackStorm, Rundeck, or a custom webhook router) - Target actions (scale, restart, ticket creation, enrichment, notifications) - Existing auth/secrets setup - Volume and burst characteristics of the events Your tasks: 1. **Sensor/trigger design** — how each event source is ingested, authenticated, and validated. Reject unsigned or malformed payloads at the door. 2. **Rule mapping** — the criteria that route an event to an action pack; how you keep rules readable and testable. 3. **Idempotency and dedup** — derive a stable event key; ensure a redelivered webhook does not double-execute. Specify the dedup window and store. 4. **Action safety tiers** — read-only enrichment actions run freely; mutating actions require guardrails (rate limit, dry-run flag, approval for high-impact). 5. **Failure handling** — retries with backoff, poison-event handling, and what happens when a downstream API is down. 6. **Observability** — correlation IDs from event → rule → action → result; how an operator traces "why did this run?" Output as: (a) the event ingestion + validation flow, (b) one full example: webhook → sensor → rule → action with idempotency key, (c) the action safety-tier table, (d) retry/dedup/poison-handling config, (e) the audit/trace model. Anti-patterns to reject: trusting unauthenticated webhooks, at-least-once delivery without idempotency, mutating actions with no rate limit, and rules so clever no one can predict what fires.