> ## 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.

# Restate services

> Resources, examples, configuration and evidence for Restate services.

Use the `@bijection/connectors/restate` entrypoint to declare Restate services 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 |
| - | - | - |
| Service | `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).

## Service

### observed: observed

The following example matches configuration `standard`.

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

export const fulfillment = restate.service.observed({
  contract: {
    digest: "88f6b18a5f48171b53c173c7d7f5318a863639017c8c245d7911973fe6242bd8",
    contract: {
      protocol: "bijection.restate.v1",
      name: "Fulfillment",
      kind: "workflow",
      start: {
        handler: "run",
        handler_kind: "workflow",
        input: {
          type: "object",
          properties: {
            order_id: { type: "string" },
            process_id: { type: "string" },
            tenant_id: { type: "string" },
            terms_hash: { type: "string" },
          },
          required: ["tenant_id", "order_id", "process_id", "terms_hash"],
          additionalProperties: false,
        },
        output: {
          type: "object",
          properties: {
            kind: {
              type: "string",
              enum: ["completed", "rejected", "expired"],
            },
            shipment_id: { type: "string" },
          },
          required: ["kind", "shipment_id"],
          additionalProperties: false,
        },
        recovery: "attach_original_invocation",
      },
      commands: {
        decide: {
          handler: "decide",
          handler_kind: "shared",
          input: {
            type: "object",
            properties: {
              actor_id: { type: "string" },
              decision: { type: "string", enum: ["approve", "reject"] },
              expected_revision: { type: "integer" },
              terms_hash: { type: "string" },
            },
            required: [
              "expected_revision",
              "terms_hash",
              "decision",
              "actor_id",
            ],
            additionalProperties: false,
          },
          output: {
            anyOf: [
              {
                type: "object",
                properties: {
                  decision: { type: "string", enum: ["approve", "reject"] },
                  decision_call_id: { type: "string" },
                  kind: { type: "string", enum: ["recorded"] },
                  revision: { type: "integer" },
                },
                required: ["kind", "decision", "decision_call_id", "revision"],
                additionalProperties: false,
              },
              {
                type: "object",
                properties: {
                  kind: { type: "string", enum: ["refused"] },
                  reason: {
                    type: "string",
                    enum: ["stale_terms", "already_decided", "expired"],
                  },
                },
                required: ["kind", "reason"],
                additionalProperties: false,
              },
            ],
          },
          refusal_kind: "refused",
          recovery: "attach_original_invocation",
        },
      },
      observation: {
        handler: "snapshot",
        output: {
          type: "object",
          properties: {
            decision_call_id: { type: "string" },
            execution_id: { type: "string" },
            order_id: { type: "string" },
            phase: {
              type: "string",
              enum: [
                "awaiting_review",
                "decision_recorded",
                "fulfilling",
                "completed",
                "rejected",
                "expired",
                "interrupted",
              ],
            },
            process_id: { type: "string" },
            revision: { type: "integer" },
            shipment_id: { type: "string" },
            tenant_id: { type: "string" },
            terms_hash: { type: "string" },
          },
          required: [
            "tenant_id",
            "order_id",
            "process_id",
            "execution_id",
            "revision",
            "terms_hash",
            "phase",
            "decision_call_id",
            "shipment_id",
          ],
          additionalProperties: false,
        },
        revision_field: "revision",
        execution_field: "execution_id",
        identity_fields: ["tenant_id", "order_id", "process_id"],
      },
      minimum_evidence_retention_seconds: 2592000,
      allow_cancel: true,
    },
  },
  release: {
    digest: "1dc9503311e9a1bc8a390ea2250c5075e2b763d0a38950cd0c27ed453cf45268",
    release: {
      dependencies: [
        {
          service_name: "FulfillmentState_orders_v1",
          kind: "VirtualObject",
          deployment_id: "dp_REPLACE_AFTER_REGISTRATION",
          service_revision: 1,
        },
        {
          service_name: "Warehouse_orders_v1",
          kind: "VirtualObject",
          deployment_id: "dp_REPLACE_AFTER_REGISTRATION",
          service_revision: 1,
        },
      ],
      build_id: "orders_v1",
      environment_id: "orders_production_01",
      service_name: "Fulfillment_orders_v1",
      deployment_id: "dp_REPLACE_AFTER_REGISTRATION",
      service_revision: 1,
      contract_digest:
        "88f6b18a5f48171b53c173c7d7f5318a863639017c8c245d7911973fe6242bd8",
      executions: [],
    },
  },
  access: {
    read: makeFunctionReference<"query", any, [null]>("permissions:workflow"),
    reads: [],
  },
  governingRules: {
    start: makeFunctionReference<"query", any, [null]>("permissions:workflow"),
    decide: makeFunctionReference<"query", any, [null]>("permissions:workflow"),
    requestCancellation: makeFunctionReference<"query", any, [null]>(
      "permissions:workflow",
    ),
  },
});
```

> **Inferred record types**
>
> ```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "key": string;
>   "service_key": string;
>   "execution_id": string;
>   "snapshot": { readonly decision_call_id: string; readonly execution_id: string; readonly order_id: string; readonly phase: "rejected" | "completed" | "expired" | "awaiting_review" | "decision_recorded" | "fulfilling" | "interrupted"; readonly process_id: string; readonly revision: number; readonly shipment_id: string; readonly tenant_id: string; readonly terms_hash: string; } & {};
>   "result": { kind: "unavailable"; } | { kind: "available"; value: { readonly kind: "rejected" | "completed" | "expired"; readonly shipment_id: string; } & {}; };
>   "runtime_status": string;
>   "runtime_observed_at": number;
>   "snapshot_revision": number;
>   "observation_id": string;
>   "contract_digest": 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: `restate/service/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 |
| `environment_id` | string | Yes | Shared connection |

> **Complete configuration contract**
>
> ```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
> {
>   "setup": [],
>   "resource": {
>     "access": {
>       "records": {
>         "read": {
>           "query": "permissions:workflow"
>         },
>         "reads": []
>       }
>     },
>     "defaults": {},
>     "connector": "http",
>     "output": {
>       "kind": "single",
>       "collection": "records"
>     },
>     "credential_kind": "http",
>     "connection_fields": [
>       "endpoint",
>       "environment_id"
>     ],
>     "address": {
>       "kind": "setup",
>       "field": "endpoint"
>     }
>   },
>   "connection_setup": {
>     "type": "object",
>     "value": {
>       "endpoint": {
>         "fieldType": {
>           "type": "string"
>         },
>         "optional": false
>       },
>       "environment_id": {
>         "fieldType": {
>           "type": "string"
>         },
>         "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": {
>     "decide": {
>       "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 |
| - | - | - | - |
| `decide` | 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": {
>           "decide": {
>             "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": {
>     "decide": {
>       "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"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| stated-cursor-empty-page-advances | \{"kind":"collection","name":"records"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| stated-cursor-repeat-refused | \{"kind":"collection","name":"records"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"decide"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"requestCancellation"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| command-response-lost | \{"kind":"command","name":"start"} | Go HTTP protocol tests and portable checks are separate from native hosted Restate qualification, which has not been run. | Execution result unavailable |
| identity-account | \{"kind":"connection"} | Fixture: ./src/connectors/restate/fixtures/identity.json | passed (2026-10-24T21:36:12.300Z) |

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

## Provider guidance

`restate.resource` compiles captured customer Service, Virtual Object and
Workflow interfaces into ordinary native HTTP resources. Bijection retains
authorization, credentials, external calls and admitted observations. Customer
Restate runs all business handlers; `bijection restate serve` is a stateless
bounded adapter.

Register `restate_contracts` in `bijection.json`, with `contract`, `release` and
an optional application-local `_generated` TypeScript `service` output.
Preparation captures local schema references, checks the exact release,
generates typed input, result and snapshot contracts, and retires removed
application binding aliases. Bind the generated resource to an authenticated
HTTPS adapter endpoint and an operator-established `environment_id`. All
requests freeze the contract, release and environment. The customer service
requires a separate private adapter token.

Services have collection commands and observed completed invocation results.
Virtual Objects have an explicit initialization handler, serialized commands and
shared snapshots. Workflows have `run`, shared interaction handlers and
snapshots. The generated wrapper retains the original start identity and refuses
commands for another execution, even after a provider key is reused. Object
inputs are named command arguments, optional fields included; other inputs are
one `input` argument. Contracts may be authored in TypeScript with
`defineContract(...)` from `@bijection/connectors/restate/contract`.

Release manifests pin a release-specific physical service name, build identity,
deployment ID and service revision. They enumerate private dependencies and
known executions. Read-only environment checks validate server profile (Restate
major 1, 1.7 or later), current routing, generated schema attestations,
concurrency kinds, retention, dependencies and original execution deployments.
These checks do not exercise business handlers. Metadata is customer release
evidence, not proof of business behavior. Deployments and original service
secrets must remain available for retained invocations.

Commands use one mutating dispatch and reconcile only by looking up the original
idempotency target and reading its output. Start confirmation verifies the exact
start request and input digest. Provider absence, purged evidence, exceptions
and lost responses retain uncertainty. The adapter never recreates an uncertain
call. Cancellation confirms runtime acceptance only; compensation and business
completion remain separate. Kill, purge and restart-as-new are operator actions.

Discovery is bounded and observations are immutable facts, with business
revisions independent from runtime status. Results remain typed retained HTTP
evidence and observed resource records; the adapter does not introduce another
call-result API. Missing or unavailable executions retain their prior
observations. Source tests and portable checks do not establish hosted
qualification.

## 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/restate/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.