Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.medera.info/llms.txt

Use this file to discover all available pages before exploring further.

The Agent Builder Canvas is a visual workflow editor backed by a real workflow engine (471-line WorkflowExecutor + 285-line WorkflowQueue on Bull/Redis, 5 concurrent workers, 3-attempt retry with 5 s exponential backoff). Workflows compose 16 core node types plus 8 BH-OS rail node types.

Lifecycle

draft → published (immutable version) → deployed (sandbox)
                                       └→ deployed (production) → archived | disabled
agent_workflows carries the current draft. Publishing snapshots the canvas into agent_workflow_versions and immediately deploys to sandbox. Promotion to production is explicit.

Optimistic concurrency

Every draft update is guarded by lock_version — concurrent edits to the same workflow return 409 idempotency_conflict. Draft auto-save is hash-deduped: identical payloads do not create new versions.

Tenant isolation

The canvas is tenant-scoped end to end:
  • agent_workflows.organization_id is RLS-enforced
  • Published versions inherit the org
  • Deployments expose https://sandbox.medera.info/{org}/{agent}-v{ver} or https://agents.medera.info/{org}/{agent} URLs
  • Sandbox deployments auto-expire 72 h after deploy (auto_expire_at)

Variable scopes

Canvas nodes can reference variables using {{scope.path}} syntax. Available scopes:
ScopeLifetimeMutabilityExample
workflow.inputPer executionImmutable{{input.patient_id}}
state.<name>Per executionMutable{{state.phq9_score}}
nodes.<id>.outputPer executionImmutable{{nodes.intake_1.output.transcript}}
runtime.contextPer executionImmutable{{runtime.organization_id}}
tenant.secretPersistentRead-only{{tenant.secret.epic_oauth_client_id}}
tenant.secret is sourced from your configured secret store (SSM / Vault) — secrets are never inlined into versions or deployments.

Real-time events (Socket.IO)

The executor emits the following events to the org room and per-execution room:
EventWhen
workflow:execution:startedExecution claimed by a worker
workflow:node:executingNode _executeNode invoked
workflow:node:completedNode returned success()
workflow:ehr-syncAn ehr-sync node read or wrote to a connected EHR
workflow:execution:pausedA user-approval node returned { paused: true }
workflow:execution:completedReached end node
workflow:execution:failedNode threw without an error handler

What’s next

Node Types

16 core nodes + 8 BH-OS rails.

Variables & Scopes

Variable resolution and template syntax.

Versioning & Deployment

Sandbox-first deployment with WORM audit.

Guardrails

HIPAA + 42 CFR Part 2 enforcement.