> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger tasks

> Resources, examples, configuration and evidence for Trigger tasks.

Use the `@bijection/connectors/trigger` entrypoint to declare Trigger tasks resources.

## Availability

This page describes the pinned source package. Published availability is unestablished for this artifact. [Source build and package availability](https://docs.bijection.com/client/sdk-distribution.md).

## Resources and modes

| Resource | Mode | Description |
| - | - | - |
| Task | `observed` | observed |

Declare a resource in application code, then bind deployment-specific settings and credentials. See [typed resources](https://docs.bijection.com/integrations/resources.md), [connections](https://docs.bijection.com/integrations/connections.md) and [source inspection](https://docs.bijection.com/integrations/cli.md).

## Task

### observed: observed

The following example matches configuration `standard`.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { trigger } from "@bijection/connectors/trigger";
import { makeFunctionReference } from "bijection/server";

export const fulfillment = trigger.task.observed({
  contract: {
    digest: "30178fefb0afdfbed0738192d6528ffcdc10eeb09a3129571f0c7df25559b5f1",
    contract: {
      name: "acme.fulfillment",
      task_id: "fulfill-order",
      protocol: "bijection.trigger.v1",
      identity: ["tenant_id", "order_id", "process_id"],
      input: {
        type: "object",
        properties: {
          order_id: { type: "string" },
          process_id: { type: "string" },
          tenant_id: { type: "string" },
          terms: {
            type: "object",
            properties: {
              charge_cents: { type: "integer" },
              revision: { type: "integer" },
              shipping_address: { type: "string" },
              shipping_method: { type: "string" },
            },
            required: [
              "revision",
              "shipping_address",
              "shipping_method",
              "charge_cents",
            ],
            additionalProperties: false,
          },
        },
        required: ["tenant_id", "order_id", "process_id", "terms"],
        additionalProperties: false,
      },
      output: {
        type: "object",
        properties: {
          outcome: {
            type: "string",
            enum: ["fulfilled", "rejected", "expired"],
          },
          shipment_id: { anyOf: [{ type: "string" }, { type: "null" }] },
        },
        required: ["outcome", "shipment_id"],
        additionalProperties: false,
      },
      progress: {
        type: "object",
        properties: {
          phase: {
            type: "string",
            enum: ["awaiting_approval", "shipping", "settled"],
          },
        },
        required: ["phase"],
        additionalProperties: false,
      },
      waitpoints: {
        shipment: {
          terms_from_input: "/terms",
          decision: {
            type: "object",
            properties: {
              approve: { type: "boolean" },
              comment: { type: "string" },
            },
            required: ["approve", "comment"],
            additionalProperties: false,
          },
          timeout_seconds: 86400,
          recovery: "read_exact_token_output",
        },
      },
      start_recovery: "observe_only_after_unknown",
      cancellation_recovery: "read_original_run",
      limits: { input_bytes: 65536, output_bytes: 65536, progress_bytes: 8192 },
    },
  },
  release: {
    digest: "0bf75231b4a765aff7da31b182db6266f481d1fb8434aaf12e9b0dd773bd5488",
    release: {
      project_ref: "proj_acme",
      project_id: "REPLACE_WITH_TRIGGER_PROJECT_ID",
      environment: "prod",
      deployment_id: "REPLACE_WITH_TRIGGER_DEPLOYMENT_ID",
      version: "20261020.1",
      content_hash: "REPLACE_WITH_DEPLOYMENT_CONTENT_HASH",
      task_id: "fulfill-order",
      contract_digest:
        "30178fefb0afdfbed0738192d6528ffcdc10eeb09a3129571f0c7df25559b5f1",
      protocol: "bijection.trigger.v1",
      retained_deployments: [],
    },
  },
  access: {
    read: makeFunctionReference<"query", any, [null]>("permissions:task"),
    reads: [],
  },
  governingRules: {
    start: makeFunctionReference<"query", any, [null]>("permissions:task"),
    requestCancellation: makeFunctionReference<"query", any, [null]>(
      "permissions:task",
    ),
    decideShipment: makeFunctionReference<"query", any, [null]>(
      "permissions:task",
    ),
  },
});
```

> **Inferred record types**
>
> ```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "key": string;
>   "run_id": string;
>   "request_id": string;
>   "subject": { tenant_id: string; order_id: string; process_id: string; };
>   "input": { readonly order_id: string; readonly process_id: string; readonly tenant_id: string; readonly terms: { readonly charge_cents: number; readonly revision: number; readonly shipping_address: string; readonly shipping_method: string; } & {}; } & {};
>   "deployment_id": string;
>   "deployment_version": string;
>   "lifecycle": string;
>   "provider_updated_at": string;
>   "attempt": number;
>   "sequence": number;
>   "progress": ({ readonly phase: "settled" | "shipping" | "awaiting_approval"; } & {}) | null;
>   "approval": { name: "shipment"; occurrence: string; review_hash: string; terms_hash: string; expires_at: number; terms: { readonly charge_cents: number; readonly revision: number; readonly shipping_address: string; readonly shipping_method: string; } & {}; status: "COMPLETED" | "WAITING" | "TIMED_OUT"; decision: { protocol: "bijection.trigger.v1"; request_id: string; run_id: string; review_hash: string; actor_id: string; value: { readonly approve: boolean; readonly comment: string; } & {}; } | null; acknowledged: boolean; } | null;
>   "result": ({ readonly outcome: "rejected" | "expired" | "fulfilled"; readonly shipment_id: string | null; } & {}) | null;
>   "contract_digest": string;
>   "release_digest": string;
>   "observation_id": string;
>   "observed_at": number;
> }
> ```

The function references identify application policy queries. Implement those policies in your application; the references alone grant no authority.

#### Configuration: standard

Case: `trigger/task/observed/standard`.

Connection and resource configuration are declared by this exact case.

Credential kind: `http`. Keep credential material in the private credential inventory.

| Setting | Type | Required | Owner |
| - | - | - | - |
| `endpoint` | string | Yes | Shared connection |
| `project_ref` | "proj\_acme" | Yes | Shared connection |
| `environment` | "prod" | Yes | Shared connection |

> **Complete configuration contract**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "setup": [],
>   "resource": {
>     "access": {
>       "records": {
>         "read": {
>           "query": "permissions:task"
>         },
>         "reads": []
>       }
>     },
>     "defaults": {},
>     "connector": "http",
>     "output": {
>       "kind": "single",
>       "collection": "records"
>     },
>     "credential_kind": "http",
>     "connection_fields": [
>       "endpoint",
>       "project_ref",
>       "environment"
>     ],
>     "address": {
>       "kind": "setup",
>       "field": "endpoint"
>     }
>   },
>   "connection_setup": {
>     "type": "object",
>     "value": {
>       "endpoint": {
>         "fieldType": {
>           "type": "string"
>         },
>         "optional": false
>       },
>       "project_ref": {
>         "fieldType": {
>           "type": "literal",
>           "value": "proj_acme"
>         },
>         "optional": false
>       },
>       "environment": {
>         "fieldType": {
>           "type": "literal",
>           "value": "prod"
>         },
>         "optional": false
>       }
>     }
>   },
>   "execution": null
> }
> ```

Native admission analysis is available for this exact declaration.

**Collection: records**

| Contract | Meaning |
| - | - |
| Initial | Enumeration of observed records |
| Changes | Repeated observations of current records |
| Deletions | Deletion detection unsupported |
| Resume | Opaque cursor |
| Gap | Explicit repair required after a gap |
| Retention | Unspecified |

> **Complete native profile**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "movement": {
>     "exchanges": {
>       "records": {
>         "200": {
>           "placement": "retained_bytes",
>           "interpretation": "json",
>           "projectsBeforeRetention": false,
>           "retainedBodyLimitBytes": "524288",
>           "fileLimitBytes": null
>         }
>       }
>     },
>     "nativeInputLimitBytes": null,
>     "steps": [
>       {
>         "id": "acquire.1",
>         "inputs": [],
>         "action": {
>           "operation": "acquire",
>           "subject": "exchange records",
>           "limitBytes": null
>         }
>       },
>       {
>         "id": "retain.1",
>         "inputs": [
>           "acquire.1"
>         ],
>         "action": {
>           "operation": "retain",
>           "subject": "acquisition evidence",
>           "reason": "recovery",
>           "release": "acquisition_custody"
>         }
>       },
>       {
>         "id": "interpret.1",
>         "inputs": [
>           "retain.1"
>         ],
>         "action": {
>           "operation": "interpret",
>           "subject": "acquired input",
>           "produces": "records"
>         }
>       },
>       {
>         "id": "materialize.1",
>         "inputs": [
>           "interpret.1"
>         ],
>         "action": {
>           "operation": "materialize",
>           "subject": "source rows",
>           "reason": "serving",
>           "release": "replacement"
>         }
>       },
>       {
>         "id": "publish.1",
>         "inputs": [
>           "materialize.1"
>         ],
>         "action": {
>           "operation": "publish",
>           "subject": "source rows",
>           "visibility": "with_acquisition"
>         }
>       }
>     ]
>   },
>   "initial": "enumeration",
>   "changes": "observations",
>   "deletions": "unsupported",
>   "resume": "opaque_cursor",
>   "retentionMs": null,
>   "gap": "explicit_repair",
>   "limits": {
>     "http_response_bytes": "524288"
>   },
>   "restrictions": [],
>   "commands": {
>     "decideShipment": {
>       "target": "records",
>       "delivery": "single_attempt",
>       "condition": "unconditional",
>       "replayWindowMs": null,
>       "maxDeliveryHours": "1",
>       "providerEnforcedExpiry": false
>     },
>     "requestCancellation": {
>       "target": "records",
>       "delivery": "single_attempt",
>       "condition": "unconditional",
>       "replayWindowMs": null,
>       "maxDeliveryHours": "1",
>       "providerEnforcedExpiry": false
>     },
>     "start": {
>       "target": "records",
>       "delivery": "single_attempt",
>       "condition": "unconditional",
>       "replayWindowMs": null,
>       "maxDeliveryHours": "1",
>       "providerEnforcedExpiry": false
>     }
>   }
> }
> ```

**Commands**

| Command | Target | Condition | Delivery |
| - | - | - | - |
| `decideShipment` | records | Unconditional | Single dispatch attempt |
| `requestCancellation` | records | Unconditional | Single dispatch attempt |
| `start` | records | Unconditional | Single dispatch attempt |

> **Commands, occurrences and artifacts**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "records": {
>     "records": {
>       "protocol": "record_observation",
>       "coverage": "records",
>       "consistency": "observations",
>       "atomicity": "record",
>       "history": "observations",
>       "recordRefresh": false,
>       "reconciliation": false,
>       "notifications": false,
>       "snapshotMaxRows": null,
>       "profile": {
>         "movement": {
>           "exchanges": {
>             "records": {
>               "200": {
>                 "placement": "retained_bytes",
>                 "interpretation": "json",
>                 "projectsBeforeRetention": false,
>                 "retainedBodyLimitBytes": "524288",
>                 "fileLimitBytes": null
>               }
>             }
>           },
>           "nativeInputLimitBytes": null,
>           "steps": [
>             {
>               "id": "acquire.1",
>               "inputs": [],
>               "action": {
>                 "operation": "acquire",
>                 "subject": "exchange records",
>                 "limitBytes": null
>               }
>             },
>             {
>               "id": "retain.1",
>               "inputs": [
>                 "acquire.1"
>               ],
>               "action": {
>                 "operation": "retain",
>                 "subject": "acquisition evidence",
>                 "reason": "recovery",
>                 "release": "acquisition_custody"
>               }
>             },
>             {
>               "id": "interpret.1",
>               "inputs": [
>                 "retain.1"
>               ],
>               "action": {
>                 "operation": "interpret",
>                 "subject": "acquired input",
>                 "produces": "records"
>               }
>             },
>             {
>               "id": "materialize.1",
>               "inputs": [
>                 "interpret.1"
>               ],
>               "action": {
>                 "operation": "materialize",
>                 "subject": "source rows",
>                 "reason": "serving",
>                 "release": "replacement"
>               }
>             },
>             {
>               "id": "publish.1",
>               "inputs": [
>                 "materialize.1"
>               ],
>               "action": {
>                 "operation": "publish",
>                 "subject": "source rows",
>                 "visibility": "with_acquisition"
>               }
>             }
>           ]
>         },
>         "initial": "enumeration",
>         "changes": "observations",
>         "deletions": "unsupported",
>         "resume": "opaque_cursor",
>         "retentionMs": null,
>         "gap": "explicit_repair",
>         "limits": {
>           "http_response_bytes": "524288"
>         },
>         "restrictions": [],
>         "commands": {
>           "decideShipment": {
>             "target": "records",
>             "delivery": "single_attempt",
>             "condition": "unconditional",
>             "replayWindowMs": null,
>             "maxDeliveryHours": "1",
>             "providerEnforcedExpiry": false
>           },
>           "requestCancellation": {
>             "target": "records",
>             "delivery": "single_attempt",
>             "condition": "unconditional",
>             "replayWindowMs": null,
>             "maxDeliveryHours": "1",
>             "providerEnforcedExpiry": false
>           },
>           "start": {
>             "target": "records",
>             "delivery": "single_attempt",
>             "condition": "unconditional",
>             "replayWindowMs": null,
>             "maxDeliveryHours": "1",
>             "providerEnforcedExpiry": false
>           }
>         }
>       }
>     }
>   },
>   "occurrences": null,
>   "artifacts": {
>     "raw_archive": false,
>     "native_file_transfer_limit_bytes": null,
>     "external_versions": false,
>     "files": {}
>   },
>   "commands": {
>     "decideShipment": {
>       "target": "records",
>       "condition": {
>         "kind": "unconditional"
>       },
>       "delivery": {
>         "kind": "single_attempt",
>         "retention": {
>           "kind": "unknown"
>         },
>         "max_delivery_hours": 1
>       }
>     },
>     "requestCancellation": {
>       "target": "records",
>       "condition": {
>         "kind": "unconditional"
>       },
>       "delivery": {
>         "kind": "single_attempt",
>         "retention": {
>           "kind": "unknown"
>         },
>         "max_delivery_hours": 1
>       }
>     },
>     "start": {
>       "target": "records",
>       "condition": {
>         "kind": "unconditional"
>       },
>       "delivery": {
>         "kind": "single_attempt",
>         "retention": {
>           "kind": "unknown"
>         },
>         "max_delivery_hours": 1
>       }
>     }
>   }
> }
> ```

**Recorded checks**

| Requirement | Scope | Evidence | Result |
| - | - | - | - |
| page-publication-recovery | \{"kind":"collection","name":"records"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| stated-cursor-empty-page-advances | \{"kind":"collection","name":"records"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| stated-cursor-repeat-refused | \{"kind":"collection","name":"records"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"decideShipment"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"requestCancellation"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"start"} | Bridge and portable tests cover protocol behavior; provider-specific native histories on a deployment remain unqualified. | Execution result unavailable |
| identity-account | \{"kind":"connection"} | Fixture: ./src/connectors/trigger/fixtures/identity.json | passed (2026-10-24T21:36:12.446Z) |

Hosted qualification: **unestablished for this catalog configuration**. Installed connections report their own identity, authority and current status.

## Provider guidance

`trigger.task.observed({ contract, release, access, governingRules })` composes native
HTTP acquisition, private credentials and governed external calls. Import the
application contract/release produced by `bijection trigger generate`; configure
an `imports` entry with `adapter: "trigger.contract"`, `source.file` and
`options.release` in `bijection.json` for normal dev/deploy preparation. The
source may be the portable JSON contract or a TypeScript module whose default
export is `defineContract(&#123; name, taskId, identity, args, returns, progress,
waitpoints &#125;)` from `@bijection/connectors/trigger/contract`; `integer()` declares
a JSON integer. Unsupported validators are refused at the authored field.

Bind an HTTPS stateless bridge endpoint, exact `project_ref` and `environment`,
and `trigger.credential(name)`. The bridge is `bijection trigger serve` in the
Bijection CLI; it calls Trigger over TLS, runs no customer tasks and retains no
journal. Binding identification checks the captured concrete deployment, version,
content hash, task inventory and authenticated project/environment. A task inventory
is not behavioral qualification. Capture rollouts with `--retain-release` to keep
explicit prior deployments of the same contract/environment in the new manifest.
New starts pin the current version; existing executions and approvals retain their
original deployment, token and review identity. Preserve old endpoints for retained
calls already accepted against their previous binding. A contract change requires
a separate resource.

Install runs through `defineSyncedTable({ source })`. Start through
`ctx.calls.add` with the generated collection command. Start arguments are the task
input's named fields, optional fields included. Record commands require an
acquired local execution row. Each `decide<Waitpoint>` member (`decideShipment`
for waitpoint `shipment`) takes `{ review_hash, actor_id, value }`;
`requestCancellation` takes no arguments. Governing rules remain mandatory and browser callers cannot supply
provider target keys or credentials.

Starts use single-attempt delivery. An unknown start is discovered and verified
without reissuing it; Trigger keys can expire or be released after failure.
Decisions address the exact run and token, and confirm only by comparing the
actual winning output with the retained envelope. A successful completion response
alone is insufficient. Reconciliation never completes a token again. Cancellation
confirms the provider run state without compensating external work.

Customer tasks import the generated helper, which uses
`@bijection/connectors/trigger/worker`. Trigger SDK 4.7.5 or later within major
version 4 is a peer dependency for that entry point. The wrapper validates input,
project/environment/version and contract before customer code, refuses manual replay,
publishes bounded progress and provides declared waitpoints. Gates recover across
attempts without renewing deadlines. It records task acknowledgement separately
from Trigger recording and business completion. External business effects still
need customer-owned idempotency or conditional writes.

`trigger.observations.select` orders one run's rows by attempt and sequence,
refuses equal-position disagreements and conflicting outcomes, and prefers a
terminal or completed-gate observation at the newest position.
`trigger.observations.approval(row, gate, now)` reports whether that waitpoint
still accepts a decision.

Only bounded inline JSON is supported. Distinct execution observations have
content-addressed source keys and explicit attempt/sequence positions. Lists establish
neither deletion nor complete history. Callback URLs and public completion tokens
are not published. Source and portable tests are separate from hosted qualification;
provider-specific native histories remain unqualified.

## Application helpers

All workflow adapters share one application vocabulary. Object-typed inputs are
named command arguments, optional fields included: adding an optional field
never wraps or renames existing arguments. Other values travel as `input`.
Bijection-owned members are camelCase (`start`, `requestCancellation`); names a
contract declares keep their spelling. Serialized routes, capability keys and
records keep their snake\_case wire names.

`<adapter>.commands(contract)` returns each command's target and argument
validators for `commandPolicy` from `bijection/server`, so a policy module types
its inputs without importing the schema that installs the resource.
`<adapter>.policies(contract, "permissions", { reads })` references one exported
policy per command name (`permissions:decideShipment`, ...). Names follow the
contract; a missing export fails deployment analysis.

`<adapter>.observations.select(rows, { bound })` interprets acquired execution
rows the application read through its own indexed queries. It returns
`current`, `missing`, `conflict` (with its reason) or `exceeded`; it never
invents ordering or infers deletion from absence. The application still decides
business association, actor permission and acceptable freshness.
`<adapter>.trace(...)` resolves a retained call's interaction from the generated
`capabilities` and composes it with an authorized observation.

## Provider references

Provider references and prerequisites are maintained in the connector guidance above. No separate provider-documentation review date is recorded.

## Source and evidence

[Canonical connector source](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/src/connectors/trigger/README.md), [native analysis](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/contract-analysis.json) and [check receipts](https://github.com/bijectionhq/component-support/blob/b632604330ce9cbcfe17a5a680ef4fbe80f6f672/packages/connectors/evidence.json).

Connector artifact: `905888ea276a2a28e36981a79e8142b2547ea451c3e63162cb6915ad4a7d1305`.

The resource declaration examples above are compiled and compared with exact catalog declarations. Recorded checks apply only to their source, declaration and runtime identities. Configure a connection and inspect its status to establish deployment-specific readiness.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.