Building Workflows, Part 1 — Core concepts and the Workflow Builder
incident.io's Workflows feature ("when X happens, if Y, do Z") is built as a small, statically typed programming language in Go. Resources act as the type system, steps are functions over resources, triggers build a scope of named references, and the Workflow Builder UI serves as the IDE. Each resource, step and trigger lives in its own file, implements a narrow interface and registers itself. Reflection-backed operation methods on filterable resources let the backend type-check conditions and drive dynamic form generation in the frontend through an HTTP API.
Related posts
- Ready, steady, goa: our API setup
incident.io mediumAdeptincident.io defines its HTTP API in Goa's design-first DSL, which generates net/http transport handlers, validation code, typed Go service interfaces, OpenAPI 3.0 specs and Go clients. This replaces hand-written Gin handlers with manual parsing, auth and serialization. On top of Goa, a `make generate-api` pipeline pretty-prints and merges the OpenAPI output and filters it into internal, mobile and public variants. Those variants feed specialised clients: typed TypeScript for the React frontend, lean mobile clients and Go test clients. A single DSL change then flows through to server code, docs and compile-time-checked frontend types.
- Building a great developer experience at a startup
incident.io mediumAdeptincident.io treats developer experience as leverage for sustaining engineering pace without accruing technical or product debt. Their practices include hot reloading, CI kept under roughly 3 minutes, PR reviews within an hour or two, Slack block-kit previews, and a Go `toolbox` CLI for running code locally or in production. Strong typing across Go and TypeScript is reinforced by a type-safe DB library, goa-generated OpenAPI clients and an exhaustive-enum `assertUnreachable` pattern. Reusable building blocks such as engine conditions, actors and `useMutation` hooks sit alongside debugging aids: per-engineer real GCP dev environments, tracing, Sentry sourcemaps and structured logs linked to traces.
- Building Workflows, Part 2 – the executor and evaluation
incident.io mediumAdeptincident.io's workflow executor listens for trigger events, evaluates workflow conditions against a scope, and creates a workflow run before executing steps. A broad 'incident-updated' trigger fixes ordering problems with multi-condition workflows. A 'once-for' column backed by a Postgres unique index provides cheap, consistent idempotency, so trigger consumers can be retried safely. To cope with Google Pub/Sub's at-least-once delivery, execution proceeds one step at a time under a SELECT FOR UPDATE row lock, with a JSON progress column recording completed steps. Runs therefore behave serially, resume after crashes without repeating steps, and double as a customer-facing audit log.
- How Zillow runs 100 million daily notifications on AWS Step Functions
AWS Architecture Blog mediumAdeptZillow replaced more than 10 per-campaign notification generator services with a configuration-driven Campaign Orchestrator that runs each of 100M+ daily email and push notifications as a short-lived AWS Step Functions Express Workflow, calling a shared library of stateless, schema-driven content modules (the Universal Content Generator) via HTTP Invoke. Step Functions beat Temporal, Flowable and an in-house engine at roughly a quarter of the build and maintenance effort. Express mode was chosen over Standard for its higher start quota and low latency, with at-least-once semantics handled by idempotent modules. Key techniques include an SQS-fed router for pausing, replay and throttling, EventBridge connections for API-key auth, component inheritance compiled into task states, a declarative config layer that AI tools can safely generate, and batching for throughput and cost.
- Build custom API integrations with incident.io
incident.io mediumAdeptincident.io launched a public API focused on three use cases: creating incidents automatically from other systems, exporting incidents and their actions and follow-ups to BI tools, and configuring roles, severities and custom fields from external sources such as Terraform. A worked example declares incidents from Zendesk by pairing a trigger with a webhook that POSTs JSON to /v1/incidents using Bearer-token auth. The create endpoint is deliberately permissive, so required custom fields are not enforced, and it requires an idempotency key so retries or repeated alerts produce only one incident.