---
title: "digital_twin_sync_loop"
description: "Synchronize digital twin state with incoming signals, detect drift, decide and execute safe actions, and record provenance."
canonical: "https://acs.synapti.ai/workflows/digital-twin-sync-loop/"
last_updated: "2026-11-16T03:28:14Z"
---

# Synchronize digital twin state with incoming signals, detect drift, decide and execute safe actions, and record provenance.

Generated from [schemas/workflow_catalog.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/workflow_catalog.yaml) at commit 18c38b74ac21.

- Workflow id: `digital_twin_sync_loop`
- Risk: high
- Catalog: reference workflows
- Declares Standard 1.1.0
- Steps: 21

**Figure: Steps of digital_twin_sync_loop: 21 steps, checkpoint at step 15, rollback at step 19.** Read top to bottom: step 16 makes the change after the checkpoint at step 15; steps 1, 16, 17, 18 and 19 have gates; steps 1, 16, 17 and 18 say what to do on failure; and the highest step risk is high, at step 16.

| # | Capability | Layer | Role | Gates | On failure | Reads from | Risk |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | `receive` | PERCEIVE |  | end | stop |  | low |
| 2 | `search` | PERCEIVE |  |  |  | 1 | low |
| 3 | `transform` | SYNTHESIZE |  |  |  | 1 | low |
| 4 | `integrate` | SYNTHESIZE |  |  |  | 3 | low |
| 5 | `detect` | UNDERSTAND |  |  |  | 4 | low |
| 6 | `classify` | UNDERSTAND |  |  |  | 5 | low |
| 7 | `state` | MODEL |  |  |  | 4 | low |
| 8 | `compare` | UNDERSTAND |  |  |  | 7 | low |
| 9 | `transition` | MODEL |  |  |  | 7 | low |
| 10 | `detect` | UNDERSTAND |  |  |  | 7, 8, 9 | low |
| 11 | `measure` | UNDERSTAND |  |  |  | 10 | low |
| 12 | `predict` | UNDERSTAND |  |  |  | 9, 10, 11 | low |
| 13 | `plan` | REASON |  |  |  | 2, 6, 8, 12 | low |
| 14 | `constrain` | VERIFY | verify |  |  | 13 | low |
| 15 | `checkpoint` | VERIFY | checkpoint |  |  |  | medium |
| 16 | `mutate` | EXECUTE | mutating | stop | rollback | 13, 14, 15 | high |
| 17 | `execute` | EXECUTE |  | skip | rollback | 16 | medium |
| 18 | `verify` | VERIFY | verify | skip | rollback | 16, 17 | medium |
| 19 | `rollback` | VERIFY | rollback | skip |  | 15, 16, 18 | medium |
| 20 | `audit` | VERIFY |  |  |  | 16, 18, 19 | medium |
| 21 | `explain` | REASON |  |  |  | 10, 11, 12, 13, 16, 18, 19 | low |

## Inputs

**Figure: Inputs of digital_twin_sync_loop.** 3 inputs, 0 required (filled pin) and 3 optional (outlined pin), with 2 named fields inside them.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `user_input` | object | No |  |
| `user_input.domain` | string | No |  |
| `user_input.constraints` | object | No |  |
| `previous_world_state` | object | No |  |
| `world_state_out` | object | No |  |

## Steps

1. [`receive`](https://acs.synapti.ai/capabilities/receive/index.md): Ingest new signals/events from sources (logs/APIs/messages). Stores `receive_out`. (risk low)
   - Gate: when `${receive_out.data} == []`, end: No new signals or events; the twin is unchanged.
2. [`search`](https://acs.synapti.ai/capabilities/search/index.md): Parallel enrichment: search for existing twin snapshot or relevant context while ingesting events. Stores `search_out`. (risk low)
3. [`transform`](https://acs.synapti.ai/capabilities/transform/index.md): Normalize raw signals into canonical events compatible with state.observations. Stores `transform_out`. (risk low)
4. [`integrate`](https://acs.synapti.ai/capabilities/integrate/index.md): Merge canonical events with existing twin snapshot; resolve conflicts via strategy. Stores `integrate_out`. (risk low)
5. [`detect`](https://acs.synapti.ai/capabilities/detect/index.md): Detect entities in integrated data. Stores `detect_entity_out`. (risk low)
6. [`classify`](https://acs.synapti.ai/capabilities/classify/index.md): Classify and resolve entity identities. Stores `classify_out`. (risk low)
7. [`state`](https://acs.synapti.ai/capabilities/state/index.md): Produce updated canonical world-state snapshot with uncertainty + provenance. Stores `state_out`. (risk low)
8. [`compare`](https://acs.synapti.ai/capabilities/compare/index.md): Compute diff between previous snapshot and updated snapshot. Stores `compare_state_out`. (risk low)
9. [`transition`](https://acs.synapti.ai/capabilities/transition/index.md): Apply transition rules triggered by new observations; compute next states. Stores `transition_out`. (risk low)
10. [`detect`](https://acs.synapti.ai/capabilities/detect/index.md): Detect drift/anomalies between expected and observed state. Stores `detect_anomaly_out`. (risk low)
11. [`measure`](https://acs.synapti.ai/capabilities/measure/index.md): Estimate risk impact/probability from drift and transitions. Stores `measure_risk_out`. (risk low)
12. [`predict`](https://acs.synapti.ai/capabilities/predict/index.md): Forecast near-term risk trajectory and triggers. Stores `predict_out`. (risk low)
13. [`plan`](https://acs.synapti.ai/capabilities/plan/index.md): Plan safe action(s) to reduce risk, with verification criteria and rollback plan. Stores `plan_out`. (risk low)
14. [`constrain`](https://acs.synapti.ai/capabilities/constrain/index.md): Enforce policy and least privilege for planned actions. Stores `constrain_out`. (risk low)
15. [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md): Create checkpoint marker before any mutation/side-effect step. Stores `checkpoint_out`. (risk medium, changes state)
16. [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md): Execute mutations from action plan (if approved). Stores `mutate_out`. (risk high, changes state, needs a checkpoint before it, needs approval)
   - Gate: when `${checkpoint_out.checkpoint_id} == null`, stop: No checkpoint created. Do not mutate.
17. [`execute`](https://acs.synapti.ai/capabilities/execute/index.md): Run verification tests and commands. Stores `execute_out`. (risk medium, needs approval)
   - Gate: when `${mutate_out} == null`, skip: No mutation was applied, so there is nothing to verify.
18. [`verify`](https://acs.synapti.ai/capabilities/verify/index.md): Verify outcome: PASS/FAIL with evidence. Stores `verify_out`. (risk medium)
   - Gate: when `${mutate_out} == null`, skip: No mutation was applied, so there is nothing to verify.
19. [`rollback`](https://acs.synapti.ai/capabilities/rollback/index.md): If a mutation was applied and verify FAILs, roll back to the checkpoint. Stores `rollback_out`. (risk medium, changes state, needs a checkpoint before it)
   - Gate: when `${mutate_out} == null || ${verify_out.passed} == true`, skip: No mutation was applied, or the twin passed verification. No rollback needed.
20. [`audit`](https://acs.synapti.ai/capabilities/audit/index.md): Record provenance, tool usage, diffs, decision rationale, and any rollback. Stores `audit_out`. (risk medium)
21. [`explain`](https://acs.synapti.ai/capabilities/explain/index.md): Produce decision-ready sync report: drift, actions, verification, next steps. Stores `explain_out`. (risk low)

## Data flow

**Figure: Which step reads which stored output.** 19 steps read the output of earlier steps, 39 reads in all; step 21 (explain) reads the most, from 7 steps.

- Step 2 reads from step 1.
- Step 3 reads from step 1.
- Step 4 reads from step 3.
- Step 5 reads from step 4.
- Step 6 reads from step 5.
- Step 7 reads from step 4.
- Step 8 reads from step 7.
- Step 9 reads from step 7.
- Step 10 reads from steps 7, 8 and 9.
- Step 11 reads from step 10.
- Step 12 reads from steps 9, 10 and 11.
- Step 13 reads from steps 2, 6, 8 and 12.
- Step 14 reads from step 13.
- Step 16 reads from steps 13, 14 and 15.
- Step 17 reads from step 16.
- Step 18 reads from steps 16 and 17.
- Step 19 reads from steps 15, 16 and 18.
- Step 20 reads from steps 16, 18 and 19.
- Step 21 reads from steps 10, 11, 12, 13, 16, 18 and 19.

## Risk

Declared and highest step risk are both high; the catalog gives no computed risk; the highest-risk step is step 16 (mutate). The step map above gives each step's risk.

## Success criteria

- Twin snapshot updated and grounded
- Drift assessed with risk score
- Any actions are approved/checkpointed/verified
- Audit trail produced

## Related

- Composed skill: [digital-twin-sync-loop](https://acs.synapti.ai/guides/skills/digital-twin-sync-loop/index.md)
- Invoked by [`digital_twin_bootstrap`](https://acs.synapti.ai/workflows/digital-twin-bootstrap/index.md)

## Validate it

```sh
python tools/validate_workflows.py --catalog schemas/workflow_catalog.yaml
```

## Workflow YAML

```yaml
digital_twin_sync_loop:
  goal: Synchronize digital twin state with incoming signals, detect drift, decide and execute safe actions, and record provenance.
  risk: high
  success:
  - Twin snapshot updated and grounded
  - Drift assessed with risk score
  - Any actions are approved/checkpointed/verified
  - Audit trail produced
  data_flow:
    pattern: step_outputs_are_addressable
    rule: Each step output stored as `store_as`; later steps may reference it.
  steps:
  - capability: receive
    purpose: Ingest new signals/events from sources (logs/APIs/messages).
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry:
      max: 3
      backoff: exponential
    store_as: receive_out
    failure_modes:
    - condition: Receiving failed (timed out or errored after its retries)
      on_error: [R401, R402]
      action: stop
      recovery: The run ends with the receive error; confirm the source configuration.
    input_bindings: {}
    gates:
    - when: ${receive_out.data} == []
      phase: after
      action: end
      message: No new signals or events; the twin is unchanged.
  - capability: search
    purpose: 'Parallel enrichment: search for existing twin snapshot or relevant context while ingesting events.'
    parallel_group: context_gathering
    join: all_complete
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: search_out
    input_bindings:
      query: ${receive_out.source}
    failure_modes: []
  - capability: transform
    purpose: Normalize raw signals into canonical events compatible with state.observations.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: transform_out
    failure_modes: []
    input_bindings:
      input: '${receive_out.data}'
      target_format: canonical_event
    gates: []
    mapping_ref: schemas/transforms/transform_mapping_rawlog_to_observation.yaml
    # The step's `output` field is one canonical event
    # (schemas/event_schema.yaml#/event); output_conforms_to would claim the
    # whole step output is.
  - capability: integrate
    purpose: Merge canonical events with existing twin snapshot; resolve conflicts via strategy.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: integrate_out
    input_bindings:
      sources:
      - '${transform_out.output: array<object>}'
      - '${previous_world_state}'
      conflict_resolution: prefer_authoritative_sources
    gates: []
    resolution_strategy: prefer_authoritative_sources
    conflict_resolution_strategies:
    - prefer_authoritative_sources
    - prefer_recent
    - prefer_high_confidence
    - merge_with_uncertainty
    - escalate_to_human
  - capability: detect
    purpose: Detect entities in integrated data.
    domain: entity
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: detect_entity_out
    failure_modes: []
    input_bindings:
      data: "${integrate_out.merged: object}"
      pattern: "entity"
    gates: []
  - capability: classify
    purpose: Classify and resolve entity identities.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: classify_out
    failure_modes: []
    input_bindings:
      item: "${detect_entity_out.matches: array<object>}"
    gates: []
  - capability: state
    purpose: Produce updated canonical world-state snapshot with uncertainty + provenance.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: state_out
    failure_modes: []
    input_bindings:
      observations: '${integrate_out.merged.observations: array<object>}'
      scope: ${integrate_out.merged.meta.world_id}
    gates: []
  - capability: compare
    purpose: Compute diff between previous snapshot and updated snapshot.
    domain: state_diff
    store_as: compare_state_out
    input_bindings:
      options:
      - '${previous_world_state: object}'
      - '${state_out.state: object}'
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    failure_modes: []
  - capability: transition
    purpose: Apply transition rules triggered by new observations; compute next states.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: transition_out
    failure_modes: []
    input_bindings:
      from_state: "${state_out.state: object}"
    gates: []
  - capability: detect
    purpose: Detect drift/anomalies between expected and observed state.
    domain: anomaly
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: detect_anomaly_out
    failure_modes: []
    input_bindings:
      data:
        observed: "${state_out.state: object}"
        expected: "${transition_out.effects: array<object>}"
        diff: "${compare_state_out: object}"
      pattern: "drift"
    gates: []
  - capability: measure
    purpose: Estimate risk impact/probability from drift and transitions.
    domain: risk
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: measure_risk_out
    failure_modes: []
    input_bindings:
      target: ${detect_anomaly_out}
      metric: "risk"
    gates: []
  - capability: predict
    purpose: Forecast near-term risk trajectory and triggers.
    domain: risk
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: predict_out
    failure_modes: []
    input_bindings:
      target: "near_term_risk"
      conditions:
        risk: "${measure_risk_out.value}"
        risk_interval: "${measure_risk_out.uncertainty: object}"
        drift_detected: "${detect_anomaly_out.detected}"
        drift: "${detect_anomaly_out.matches: array<object>}"
        transitions: "${transition_out.rules: array<object>}"
    gates: []
  - capability: plan
    purpose: Plan safe action(s) to reduce risk, with verification criteria and rollback plan.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: plan_out
    failure_modes: []
    input_bindings:
      context:
        forecast: "${predict_out: object}"
        state_diff: "${compare_state_out: object}"
        entities: "${classify_out.labels: array<object>}"
        related_context: "${search_out.results: array<object>}"
      goal: "Reduce the detected drift and risk"
    gates: []
  - capability: constrain
    purpose: Enforce policy and least privilege for planned actions.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: constrain_out
    failure_modes: []
    input_bindings:
      target: "${plan_out.steps: array<object>}"
      constraints: ["least_privilege", "change_policy"]
    gates: []
  - capability: checkpoint
    purpose: Create checkpoint marker before any mutation/side-effect step.
    risk: medium
    mutation: true
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: checkpoint_out
    failure_modes: []
    input_bindings:
      scope: "twin_state"
    gates: []
  - capability: mutate
    purpose: Execute mutations from action plan (if approved).
    risk: high
    mutation: true
    requires_checkpoint: true
    requires_approval: true
    timeout: 5m
    retry: null
    store_as: mutate_out
    failure_modes:
    - condition: The mutation failed or timed out
      on_error: [R401, R402]
      action: rollback
      recovery: Roll back the twin to the checkpoint taken before the mutation; the run then ends with the mutate step's error, and the audit step does not run; the run record the host keeps (STANDARD v1.2 §5.19.8) records the failure.
    input_bindings:
      target: "twin_state"
      operation:
        apply: "${plan_out.steps: array<object>}"
    gates:
    - when: ${checkpoint_out.checkpoint_id} == null
      action: stop
      message: No checkpoint created. Do not mutate.
    condition: ${constrain_out.compliant} == true
    skip_if_false: true
  - capability: execute
    purpose: Run verification tests and commands.
    risk: medium
    mutation: false
    requires_checkpoint: false
    requires_approval: true
    timeout: 5m
    retry: null
    store_as: execute_out
    failure_modes:
    - condition: The verification suite failed or timed out
      on_error: [R401, R402]
      action: rollback
      recovery: Roll back the twin to the checkpoint so the unverified mutation does not stay in place; the run then ends with the execute step's error, and the audit step does not run; the run record the host keeps (STANDARD v1.2 §5.19.8) records the failure.
    input_bindings:
      code: "run_verification_suite"
    gates:
    - when: ${mutate_out} == null
      action: skip
      message: No mutation was applied, so there is nothing to verify.
  - capability: verify
    purpose: 'Verify outcome: PASS/FAIL with evidence.'
    risk: medium
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: 5m
    retry:
      max: 3
      backoff: exponential
    store_as: verify_out
    failure_modes:
    - condition: Verification could not run (timed out or failed after its retries)
      on_error: [R401, R402]
      action: rollback
      recovery: Roll back the twin to the checkpoint so no unverified change stays in place; the run then ends with the verify step's error, and the audit step does not run; the run record the host keeps (STANDARD v1.2 §5.19.8) records the failure.
    input_bindings:
      target: "${execute_out: object}"
      conditions: ["drift_resolved", "no_policy_violation"]
    gates:
    - when: ${mutate_out} == null
      action: skip
      message: No mutation was applied, so there is nothing to verify.
  - capability: rollback
    purpose: If a mutation was applied and verify FAILs, roll back to the checkpoint.
    risk: medium
    mutation: true
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: rollback_out
    failure_modes: []
    input_bindings:
      checkpoint_id: "${checkpoint_out.checkpoint_id}"
    gates:
    - when: ${mutate_out} == null || ${verify_out.passed} == true
      action: skip
      message: No mutation was applied, or the twin passed verification. No rollback needed.
  - capability: audit
    purpose: Record provenance, tool usage, diffs, decision rationale, and any rollback.
    risk: medium
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: audit_out
    failure_modes: []
    input_bindings:
      event:
        type: "digital_twin_sync"
        mutated: "${mutate_out.success}"
        verified: "${verify_out.passed}"
        rolled_back: "${rollback_out.restored}"
    gates: []
  - capability: explain
    purpose: 'Produce decision-ready sync report: drift, actions, verification, next steps.'
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: explain_out
    failure_modes: []
    input_bindings:
      conclusion:
        drift_detected: "${detect_anomaly_out.detected}"
        risk: "${measure_risk_out.value}"
        forecast: "${predict_out.prediction: object}"
        actions: "${plan_out.steps: array<object>}"
        # mutated and verified are null when no mutation was applied (the
        # mutate, execute and verify steps were skipped)
        mutated: "${mutate_out.success}"
        verified: "${verify_out.passed}"
        # null when the rollback step was skipped: no mutation was applied,
        # or the twin passed verification
        rolled_back: "${rollback_out.restored}"
    gates: []
  workflow_extensions:
    supports_input_bindings: true
    supports_conditions: true
    supports_parallel_groups: true
    supports_recovery_loops: false
    supports_gates: true
  inputs:
    user_input:
      type: object
      properties:
        domain:
          type: string
        constraints:
          type: object
    previous_world_state:
      type: object
      ref: schemas/world_state_schema.yaml#/world_state
    world_state_out:
      type: object
      ref: schemas/world_state_schema.yaml#/world_state
```
