An AutoBlock is your consumer-facing automation unit (internal/system term: routine). You create AutoBlocks through a guided wizard at /routines/new, manage them on /routines, and inspect or edit individual blocks at /routines/[id].
Domain types: packages/workflow-domain/src/types.ts. Product UI: apps/product-web/src/features/routines/.
AutoBlock structure
| Part | Phase 1 kinds | Purpose |
|---|---|---|
| Trigger | manual, schedule, inbound_webhook | When the AutoBlock runs |
| Steps | notification, outbound_webhook, storage | What happens each run |
| Rules | equals, contains, greater_than | Optional filters on step flow |
| Metadata | name, description, enabled | Dashboard display and control |
flowchart TB
AB["AutoBlock"]
T["Trigger<br/>1 per AutoBlock"]
S1["Step 1 — notification"]
S2["Step 2 — outbound_webhook"]
S3["Step 3 — storage"]
R["Rules — optional"]
AB --> T
AB --> S1 --> S2 --> S3
AB --> R
Creation paths
| Path | Entry | Best for |
|---|---|---|
| Template wizard | /routines/new?template={slug} | Fastest time to value |
| Blank wizard | /routines/new | Custom name + trigger from scratch |
| AI-guided | /routines/new?ai=1 or AI panel in onboarding | Describe intent in plain language |
| From template library | /templates → detail → Create | Browse before committing |
Wizard steps (typical flow)
| Step | What you do | Validation |
|---|---|---|
| 1 — Name | Give your AutoBlock a clear name | Required |
| 2 — Trigger | Pick manual, schedule, or inbound webhook | One trigger only |
| 3 — Steps | Add notification, webhook, or storage steps | At least one step |
| 4 — Rules | Optional conditions | Must use supported operators |
| 5 — Review | Confirm trigger config + steps | Wizard blocks invalid combos |
| 6 — Activate | Enable or save as draft | Plan limits checked on save |
Mobile supports summary/card editing for straightforward changes. Desktop adds richer schedule (cron) controls.
Dashboard actions
| Action | Where | API |
|---|---|---|
| List AutoBlocks | /routines | GET /routines |
| Open detail | /routines/[id] | GET /routines/:id |
| Edit | Detail view | PUT or PATCH /routines/:id |
| Run now | Detail view (manual trigger) | POST /routines/:id/execute |
| Pause | Toggle enabled off | PATCH /routines/:id |
| Create new | /routines/new | POST /routines |
List UI: apps/product-web/src/features/routines/routines-list.tsx — includes New AutoBlock and New with AI links.
Enable vs draft
| State | Behavior |
|---|---|
| Enabled | Triggers fire (schedule ticks, webhooks accepted, manual run available) |
| Disabled (draft) | Saved definition only; no automatic runs |
Turn off an AutoBlock anytime from the detail view if you need to pause without deleting.
Plan limits on create
Creating or enabling AutoBlocks checks entitlements (packages/billing/src/plans.ts). If you exceed your plan:
| HTTP status | Error | What to do |
|---|---|---|
| 402 | entitlement_limit_exceeded | Upgrade on /billing or remove unused AutoBlocks |
Wizard + AI interaction
sequenceDiagram
participant You
participant Wizard as routines/new
participant AI as AI assist panel
participant API as api.autoblocks.run
You->>Wizard: Open /routines/new?ai=1
You->>AI: Describe intent
AI->>API: POST /tenants/:id/ai/draft
API-->>AI: RoutineDraft
AI-->>Wizard: Pre-filled steps
You->>Wizard: Review + edit
You->>API: POST /routines
API-->>You: AutoBlock created
See AI assist for draft, refine, repair, and explain endpoints.
Example: create from template (conceptual)
Module: apps/product-web/src/lib/routine-factory.ts
After choosing Morning summary from /templates/morning-summary:
- Wizard pre-fills schedule trigger + notification step.
- You adjust schedule time and notification message.
- Activate — first scheduled run appears in Activity after the worker tick.