Skip to content
← All templates

Workflow starter · custom workers required

Form-to-PDF With Outcome Validation

Generate a PDF from a form, validate the artifact, attach it to the source record, and repair failures safely.

Workflow sequence

  1. 01Receive form webhook
  2. 02Validate source fields
  3. 03Render versioned PDF
  4. 04Check size and required text
  5. 05Store with idempotency key
  6. 06Link to source record
  7. 07Notify or repair

Sequence definition

Use this sequence definition as a starting point. Set tenant_id to your tenant and use a fresh UUID for id before publishing. Implement the named business handlers in your workers; the JSON does not include provider integrations. Keep credentials in the credential store.

{
  "id": "62954997-cf57-552a-b94d-dc32d7f9801c",
  "tenant_id": "demo",
  "namespace": "default",
  "name": "form_to_pdf_v1",
  "version": 1,
  "deprecated": false,
  "blocks": [
    {
      "type": "step",
      "id": "validate",
      "handler": "validate_form",
      "params": {}
    },
    {
      "type": "step",
      "id": "render",
      "handler": "render_pdf",
      "params": {},
      "retry": {
        "max_attempts": 3,
        "initial_backoff": 1000,
        "max_backoff": 10000,
        "backoff_multiplier": 2
      }
    },
    {
      "type": "step",
      "id": "verify",
      "handler": "verify_pdf",
      "params": {}
    },
    {
      "type": "step",
      "id": "store",
      "handler": "store_artifact",
      "params": {
        "idempotency_key": "{{context.data.form_id}}:{{context.data.template_version}}"
      }
    },
    {
      "type": "step",
      "id": "link",
      "handler": "link_source_record",
      "params": {}
    },
    {
      "type": "step",
      "id": "notify",
      "handler": "notify_document_ready",
      "params": {}
    }
  ],
  "created_at": "2026-09-05T00:00:00Z"
}

Handlers must validate required inputs and outputs. Quote extraction returns confidence; document validation returns needs_review; source archiving returns sha256. Guards read these values through outputs, and approval decisions through context.data.

Idempotency keys in params are a contract for your worker to enforce at the provider. They do not make an external write exactly-once automatically.

Steps with wait_for_input resume through an authorized human_input:{block_id} signal carrying a declared choice. A CRM or scheduling integration may supply a verified choice. Timeouts fail the wait; they do not select a follow-up or escalation branch automatically. Configure alerts and recovery for timed-out runs before production.

Review rejection skips the guarded publish or spreadsheet write. No write is authorized merely because the review step finished.

Production controls to keep

Stable idempotency keys around external writes

Explicit validation before the success state

Bounded retries with provider-aware backoff

Searchable source and destination identifiers

A named owner for exhausted retries

A replay test using duplicate input

Run this workflow

Install Orch8, connect the handlers, then test duplicate delivery and worker interruption before production.

Open the quickstart