Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

incident.io 19 min read Case study mediumAdept

Building Workflows, Part 2 – the executor and evaluation

incident.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.

Related posts

  • Running Durable Workflows in Postgres using DBOS

    Supabase mediumAdept

    DBOS implements durable workflows entirely in Postgres: workflow and step decorators record a workflow's ID, inputs and status in a workflow_status table and each step's output in operation_outputs, all within a separate system database. On restart, a background thread re-runs PENDING workflows with their original inputs and skips steps whose outputs are already stored, so execution resumes from the last completed step. This relies on workflows being deterministic. Because a step transition is a ~1ms Postgres write rather than a ~100ms external dispatch, DBOS claims 25x the speed of AWS Step Functions, and it offers exactly-once transactional steps and idempotency keys used as workflow IDs.

  • Workflows are coming to Supabase

    Supabase mediumAdept

    Supabase is building Workflows, an open source orchestration engine written in Elixir that uses the Amazon States Language to coordinate existing functions (AWS, GCP, Azure, OpenFaaS, Postgres) in response to database events or HTTP calls. Jobs, queues and logs are stored in Postgres via Oban. Workflows can be persistent, surviving restarts, or transient and in-memory. A worked example shows a state machine that maps over Realtime INSERT events on a users table, waits 86400 seconds, then sends a templated welcome email. The interpreter is already open sourced on Hex, with dashboard integration and a Zapier-like UI planned.

  • Durable and auditable workflows with DBOS and ClickHouse Managed Postgres

    ClickHouse mediumAdept

    DBOS, an open-source Postgres-native durable execution library, stores workflow and step checkpoints, queues and schedules in Postgres so crashed processes resume from the last completed step without a separate orchestrator. The walkthrough runs the DBOS Python starter app against ClickHouse Managed Postgres, then uses WalShadow (private preview) to replicate the dbos schema from the Postgres WAL into ClickHouse. With WalShadow's soft-delete setting, deletions arrive as tombstone rows (_is_deleted = 1, _commit_ts) in a ReplacingMergeTree. That lets teams keep short retention in Postgres (e.g., seven days) while holding years of auditable workflow history in ClickHouse.

  • Postgres as Your Platform: Building Event-Driven Systems with Schema Changes

    Neon mediumAdept

    Postgres event triggers, transactional DDL and LISTEN/NOTIFY can turn schema changes into reliable events that drive downstream automation such as SDK generation, warehouse syncs and documentation updates, with no external queue. The pattern uses a ddl_command_end event trigger that writes pg_event_trigger_ddl_commands() metadata to an outbox table and calls pg_notify, all inside the DDL transaction, so events exist exactly when the schema change commits. A Python psycopg2 worker listens for notifications and claims rows from the outbox, which also supports polling fallback, replay and monitoring of backlog. Practical details cover tagging tenant schemas, using a session setting to avoid infinite loops when automation itself runs DDL, connecting directly rather than through a pooler, and keeping Neon listeners from scaling to zero.

  • Service disruption on October 20, 2025

    incident.io mediumAdept

    The October 20, 2025 AWS us-east-1 outage degraded incident.io through third-party dependencies even though it runs on Google Cloud: its transcription, SAML, telecom and status page providers were all affected. Delayed SMS and phone notifications cascaded because notification queues shared worker capacity, and slow retries stretched jobs to 30s. Fixes were blocked by a hidden Docker Hub base-image dependency in the deploy pipeline. Scaling escalation workers made things worse because dead tuples in a Postgres index made queue acquisition consume about 50% of worker capacity, and a rate-limiter bug applied limits only to the top 10 organisations. Remediations include a self-contained GCP build pipeline, region failover for Scribe, aggressive autovacuum, reworked acquisition logic, and per-provider isolated notification workers.

The quest for software engineering knowledge.

Look:
Layout: