Skip to main content
Sequences are ideal for orchestrating recurring system-level tasks, such as daily reports, database maintenance, or health checks.

Daily Metric Snapshots

This pattern allows you to take a “snapshot” of your key performance indicators (KPIs) every day at midnight and report them to your team.
# Daily KPI Snapshot
snapshotRevenue:
  path: /webhooks/metrics/revenue
snapshotActiveUsers:
  path: /webhooks/metrics/active-users
notifySlack:
  path: /webhooks/notifications/slack
  requires:
    - snapshotRevenue
    - snapshotActiveUsers

Why this works

  1. Parallel Execution: snapshotRevenue and snapshotActiveUsers capture data simultaneously.
  2. Aggregation: notifySlack waits for both snapshots to finish successfully before posting a summary.
  3. Reliability: Partial failures stop the reporting step, ensuring you only report complete data.

Deploying this sequence

Define the full sequence in posthook.toml:
[[sequences]]
name = "daily-kpi-snapshot"
start_at = "2026-03-01T00:00:00Z"

[sequences.schedule]
frequency = "daily"
timezone = "America/New_York"
time = { hour = 0, minute = 0 }

[sequences.steps.snapshot-revenue]
path = "/webhooks/metrics/revenue"

[sequences.steps.snapshot-active-users]
path = "/webhooks/metrics/active-users"

[sequences.steps.notify-slack]
path = "/webhooks/notifications/slack"
depends_on = ["snapshot-revenue", "snapshot-active-users"]
npx posthook apply

Periodic Health Checks

You can run distributed health checks every few minutes to verify system uptime.
# 5-min Health Check
pingServiceA:
  path: /webhooks/service-a/health
pingServiceB:
  path: /webhooks/service-b/health
pingDatabase:
  path: /webhooks/database/health
All checks run in parallel, giving you a comprehensive snapshot of system health at that moment.