Engineering guide · ICAM

Durable ICAM Workflows

Status: currentReviewed: 2026-07-26Audience: backend developers, ICAM integrators
On this pageRequestState ModelIndependent DecisionReplay And ConcurrencyStorage And EvidenceRecovery And CompensationAPI-Invoked Flows And Workload Grants

Supported workflow types include joiner, mover, leaver, access request, certification revoke, step-up, break-glass, application onboarding, federation onboarding, and evidence export.

Managed action-card connections and enforceable folder authorization are documented in Workflow Connections And Folder Authority. Direct secret references are not activatable, and a bearer capability no longer implies access to every workflow folder.

Request

POST /api/v1/icam/workflows/leaver HTTP/1.1
Authorization: Bearer <access-token>
Idempotency-Key: jml-20260723-000184
Content-Type: application/json
{
  "subjectRef": "user:9d31...",
  "resourceRef": "application:mission-portal",
  "idempotencyKey": "jml-20260723-000184",
  "correlationId": "corr-...",
  "inputs": {
    "connectionId": "scim-...",
    "appId": "mission-portal"
  }
}

The header is required. If the body also contains idempotencyKey, both values must match. Inputs may contain business data and approved references. Fields whose names imply passwords, secrets, tokens, assertions, credentials, or private keys are rejected unless the field name ends in Ref or Reference and the string uses an approved vault://, kms://, or pkcs11:// scheme. Raw values and reference-shaped field names with unapproved schemes fail closed.

State Model

The current durable state model distinguishes approval-required, approved, executing, succeeded, partial, failed, compensated, compensation-failed, capability-gated, and rejected.

Joiner, mover, leaver, certification revoke, break-glass, application onboarding, and federation onboarding begin in approval-required. No downstream service is called in that state. Access-request, step-up, and evidence-export workflows may proceed without this additional ICAM-level approval because their owning service applies its own policy boundary.

approved is a short recoverable state between a committed independent approval and a worker claim. A compare-and-swap transition moves it to executing. The terminal result and every downstream execution reference are stored with the durable record.

Independent Decision

POST /api/v1/icam/workflow-executions/icam-.../decision HTTP/1.1
Authorization: Bearer <different-operator-token>
Content-Type: application/json
{
  "decision": "approved",
  "reason": "Validated authoritative HR termination record",
  "expectedVersion": 1
}

The decision requires capability icam.workflow.approve, fresh AAL2, a non-empty session, and an authenticated operator different from requestedBy. Atlas hashes the tenant, canonical request, decision, approver, session reference, AAL, reason, and decision time into bindingHash.

Replay And Concurrency

The workflow store binds an idempotency key to tenant, workflow type, subject, resource, actor, and canonical request hash. An exact retry returns the existing record and never invokes downstream services again. Reusing a key with a different request returns 409. Optimistic versioning prevents two decisions or claims from winning the same transition.

Use these inspection endpoints:

  • GET /api/v1/icam/workflow-executions

  • GET /api/v1/icam/workflow-executions/{executionId}

  • GET /api/v1/icam/workflow-executions/{executionId}/events

  • POST /api/v1/icam/workflow-executions/{executionId}/resume

The event inspector verifies version continuity and event digests before returning records. Each transition carries a stateSha256 digest of the committed workflow state plus its previousHash / evidenceHash links, and the response reports integrity: verified. The decrypted request payload, requester session hash, and approver session hash are never returned.

Storage And Evidence

icam_workflow_executions is tenant-scoped and uses optimistic versions. The serialized request and every checkpoint/result envelope are encrypted with Vault Transit key atlas-icam-workflows. Result integrity is bound to the tenant and execution identifiers, while only SHA-256 integrity hashes and non-secret routing fields remain queryable. Legacy JSON result rows remain readable during migration, but new writes keep that plaintext column null. icam_workflow_events is an append-only hash chain written in the same PostgreSQL transaction as each state transition. PostgreSQL guards reject event update/delete operations, immutable execution-field changes, version jumps, and state commits without a matching evidence event.

Recovery And Compensation

Approved and executing records survive gateway restart and are indexed for recovery. An executing record carries a five-minute worker lease bound to the authenticated actor and a one-way session hash. Each downstream checkpoint renews the lease. Resume records a recovery-claim event; an unexpired lease can only be renewed by its exact actor/session, while an expired lease can be claimed by another authorized AAL2 operator. Each downstream group is checkpointed before the next group begins, and stable mutation identities recover an uncheckpointed exact replay without creating duplicate lifecycle jobs, access requests, PAM requests, certification decisions, identities, or application drafts.

Joiner and mover workflows execute bounded compensations when a later lifecycle step fails:

  • a joiner soft-terminates an identity only when encrypted checkpoint evidence proves that exact workflow created it;

  • a matching pre-existing identity is preserved;

  • a mover restores the encrypted prior email, clearance, status, and attributes, including removal of attributes introduced by the failed move;

  • missing creation provenance or prior state fails closed as compensation-failed;

  • compensation actions are checkpointed before the explicit compensated or compensation-failed terminal event.

Leaver workflows intentionally use forward recovery and never reactivate a terminated identity as compensation. Automatic delayed retry scheduling remains outside this coordinator; the owning lifecycle job retains its bounded retry and dead-letter behavior. The Docker gate includes real PostgreSQL identity mutation, Vault-encrypted compensation checkpoints/results, process reconstruction, and evidence-chain verification, but deployment-level proof is not claimed until that gate runs in the target environment.

API-Invoked Flows And Workload Grants

Human operators can invoke an active API flow with POST /api/v1/icam/flows/{flowId}/execute, an Atlas access token, fresh AAL2, capability icam.flow.execute, and a 16-200 character Idempotency-Key header.

Non-human workloads use a narrower two-step exchange. A fresh AAL2 operator with icam.flow.manage first issues a grant:

POST /api/v1/icam/flow-definitions/account-sync/invocation-tokens HTTP/1.1
Authorization: Bearer <operator-access-token>
Content-Type: application/json

{
  "subject": "deployment-controller",
  "idempotencyKey": "account-sync-20260723-0001",
  "variables": {
    "source": "authoritative-hr"
  },
  "ttlSeconds": 300
}

The response is marked Cache-Control: no-store and contains a signed AtlasFlow token. Its claims bind the tenant, currently active flow version and folder, workload subject, exact idempotency key, canonical variable SHA-256 digest, audience, unique token ID, issue time, and expiry. TTL is limited to 1-15 minutes. Variable values are not embedded in the grant, and secret-like input is rejected before signing.

The workload then invokes the purpose-built machine endpoint:

POST /api/v1/flow-invocations/account-sync/execute HTTP/1.1
Authorization: AtlasFlow <invocation-token>
Content-Type: application/json

{
  "variables": {
    "source": "authoritative-hr"
  }
}

This endpoint does not accept a browser session token and never accepts the grant in a URL or request body. Atlas verifies the signature, audience, lifetime, tenant, flow ID, still-enabled signed version and folder, subject, idempotency key, and canonical input digest before creating an execution. A grant cannot be moved to another flow or input set. Concurrent or repeated exact calls while the grant is valid converge on the same PostgreSQL execution; changed inputs return 409. Invalid, expired, tampered, wrong-flow, and unknown-version grants all return the same generic 401 challenge.

Flow variables and step attempts are encrypted with Vault Transit key atlas-icam-flow-control. The token itself is not persisted. Execution evidence records the workload subject as requestedBy and remains an append-only, state-bound hash chain. The bounded Docker gate reconstructs the service on PostgreSQL, replays the signed grant, verifies execution convergence and evidence recovery, and inspects the Vault ciphertext for plaintext leakage.