AutoBlocksCalm automation for everyday life

Triggers and execution

Every AutoBlock has exactly one trigger that defines when a run starts. Steps (notifications, outbound webhooks, storage) run after the trigger fires. Outbound webhooks are steps — not triggers.

Source: packages/workflow-domain/src/types.ts, apps/api/src/modules/routines/routes.ts, apps/api/src/modules/webhooks/routes.ts, apps/worker/src/index.ts.


Trigger types

KindUser labelStarts whenConfigure in
manualRun on demandYou tap RunDashboard / routine detail
scheduleRecurring scheduleCron tick matchesWizard (cron + timezone on desktop)
inbound_webhookInbound webhookExternal POST to your URLWizard shows personal endpoint path

Trigger comparison

TriggerYou control timingExternal system neededPlan limit field
ManualYes — immediateNo
ScheduleYes — cron/timezoneNo (worker must be running)scheduleLimit
Inbound webhookNo — event-drivenYes — caller POSTswebhookLimit

Trial: 2 schedules, 1 webhook endpoint. Starter: 3 schedules, 2 webhooks. Plus: 15 schedules, 10 webhooks.


Manual execution

sequenceDiagram
  participant You
  participant App as product-web
  participant API
  participant Worker
  participant Activity

  You->>App: Tap Run on /routines/[id]
  App->>API: POST /routines/:id/execute
  API->>API: Check execution limit
  API->>API: Insert pending execution run
  Worker->>API: Poll pending runs
  Worker->>Worker: executeRun()
  Worker->>Activity: Status + logs available
  You->>App: View /activity

Manual runs count against your monthly execution limit.


Scheduled execution

The worker (apps/worker) polls Postgres every few seconds (WORKER_POLL_MS, default 3000ms):

  1. Loads enabled schedules from the database.
  2. Computes previous cron tick in the schedule's timezone.
  3. If due and under execution limits, inserts a pending run with triggerKind: schedule.
  4. Processes pending runs in the same poll loop.
RequirementWhy
Worker service runningSchedules do not execute from the browser
Valid cron expressionInvalid cron is skipped silently
AutoBlock enabledDisabled routines do not schedule
Entitlement headroomOver-limit tenants skip schedule ticks

Desktop wizard exposes full cron strings. Mobile favors simpler schedule presets where available.


Inbound webhook execution

Each inbound-webhook AutoBlock gets a unique path token. External systems POST to:

POST https://api.autoblocks.run/hooks/{pathToken}
Content-Type: application/json

Optional header:
Idempotency-Key: unique-key-per-event
ResponseMeaning
200 + executionRunIdRun started (or replay if idempotency key seen)
404Unknown or disabled endpoint
402Execution limit exceeded

Handler: apps/api/src/modules/webhooks/routes.ts. Idempotency prevents duplicate runs from retries.


Step types (after trigger)

Step kindWhat it doesTypical use
notificationEmail and/or in-app alertReminders, failure alerts
outbound_webhookPOST JSON to your URLCRM relay, Slack-compatible hooks
storagePersist run outputAudit trail in Activity logs

Steps run in order field sequence. Rules can gate steps using supported operators.


Execution lifecycle

stateDiagram-v2
  [*] --> pending: Trigger fires
  pending --> running: Worker picks up
  running --> succeeded: All steps OK
  running --> failed: Step or validation error
  succeeded --> [*]
  failed --> [*]

View status on /activity. Failed runs include plain-language explanations — check Activity before opening a support thread.


Execution limits

PlanExecutions / month
Trial100
Starter500
Plus5,000

When exceeded, new runs return HTTP 402 until the next billing period or upgrade.


Verify triggers are working

TriggerCheck
ManualRun once → immediate row in Activity
ScheduleWait for tick → Activity row with schedule metadata
WebhookSend test POST with curl → Activity row

Example test webhook:

curl -X POST "https://api.autoblocks.run/hooks/YOUR_PATH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"test": true}'

Replace YOUR_PATH_TOKEN with the token shown in your AutoBlock detail view.


Related reading