Hookway

Temporal — destinations/temporal

# examples/destinations/temporal.yaml
#
# Reference config for a Temporal destination.
#
# Each webhook event starts one workflow execution. The publish `target` is
# the Temporal task queue. publish.temporal selects the registered workflow
# and controls its input, identity, duplicate behavior, and execution deadlines.
#
# An execution that already exists for the derived workflow id counts as
# delivered (first-start-wins), so sender retries with a deterministic id are
# idempotent.
#
# There is no dead-letter path: any other start failure returns a 503 so the
# sender retries.

server:
  addr: ":8080"
  max_body_bytes: 1048576

destinations:
  orchestrator:
    type: temporal
    temporal:
      # Frontend gRPC address. Self-hosted: "host:7233". Temporal Cloud:
      # "<namespace>.<account>.tmprl.cloud:7233".
      host_port: "${TEMPORAL_ADDRESS}"
      namespace: "${TEMPORAL_NAMESPACE}"
      # Temporal Cloud API key. Sent as a bearer credential, so it requires
      # tls.enabled: true. Omit for an unauthenticated self-hosted cluster.
      # api_key: "${TEMPORAL_API_KEY}"
      # Bound on the startup Dial (fail-fast). Default 10s.
      connect_timeout: "10s"
      # Bound on each start-workflow RPC. Default 5s; keep it below
      # server.publish_timeout.
      start_timeout: "5s"
      # TLS. Omit or set enabled: false for plaintext (Hookway logs a startup
      # warning). Required for Temporal Cloud. Cert paths must be mounted into
      # the container image.
      tls:
        enabled: false
        # ca_cert: "/etc/hookway/temporal-ca.pem"
        # client_cert: "/etc/hookway/temporal-client.crt"  # mutual TLS
        # client_key:  "/etc/hookway/temporal-client.key"  # both or neither
        # server_name: "temporal.internal"
        # insecure_skip_verify: false

flows:
  order_events:
    nodes:
      - {id: in, type: http_trigger, path: /webhooks/orders, methods: [POST]}
      - {id: body, type: read_body, max_bytes: 1048576}
      - {id: auth, type: auth, scheme: hmac_sha256_hex, secret: "${WEBHOOK_SECRET}", signature_header: X-Hub-Signature-256}
      - {id: env, type: envelope, body_format: json}
      # Temporal task queue. `create:` has no meaning for Temporal.
      - id: out1
        type: publish
        destination: orchestrator
        target: order-events
        temporal:
          workflow_type: OrderWorkflow
          input: body
          workflow_id: {source: body, path: id, prefix: order-}
          id_reuse_policy: reject_duplicate
          execution_timeout: 24h
          run_timeout: 1h
          task_timeout: 10s
      # Second task queue. Workflow id defaults to the Hookway event id.
      - {id: out2, type: publish, destination: orchestrator, target: order-audit, temporal: {workflow_type: AuditWorkflow, input: envelope}}
    edges: [in>body, body>auth, auth>env, env>out1, env>out2]