Initial import of zapier-user-docs from zapier monorepo

This commit is contained in:
George Lambert 2026-09-11 14:07:06 -04:00
commit 03a7de57d0
16 changed files with 298 additions and 0 deletions

22
05-wait-async-hooks.md Normal file
View file

@ -0,0 +1,22 @@
# 5. Wait, async, and completed hooks
Timestamping is not always instant. Middleware publishes `verae.zapier.jobs.watch`; a poller waits on the chain; then `verae.zapier.jobs.events` fires. Zapier never sees those subjects.
## Choose a pattern
| Pattern | Use when |
|---------|----------|
| **Wait** | The next Zap step needs the certificate now (Slack message, PDF receipt). |
| **Async + Find Job Status** | You stored `jobId` and will poll later. |
| **Timestamp Completed trigger** | You want a second Zap to run when the seal exists (REST Hook). |
If **Wait** returns `status: pending`, the chain or NATS event did not finish inside `WAIT_TIMEOUT_MS`. Pair async creates with the **Timestamp Completed** trigger instead of raising the timeout blindly.
## Trigger setup
1. New Zap → Verae Time → **Timestamp Completed**.
2. Zapier registers a REST Hook URL with middleware (`/zapier/v1/webhooks/subscribe`).
3. When `jobs.events` says `timestamp.completed`, middleware HTTPS POSTs that URL.
4. Turning the Zap off unsubscribes the hook.
The hook payload is the same completed-job JSON as wait (seal receipt, optional attached metadata).