BPMN Extensions
Agentwerke runs standard BPMN 2.0 with extension elements in the namespace:
https://agentwerke.de/bpmn/extensions/v1The XML prefix currently shown as autofac: is a stable workflow wire-format prefix, not the product name. Keep it in BPMN examples so workflows round-trip through the current designer and runtime.
Include BPMN diagram layout information so the workflow renders correctly in the designer and run detail views.
autofac:agentTask
Use autofac:agentTask on a serviceTask or scriptTask to make a task executable by an agent or deterministic tool.
<bpmn:serviceTask id="Implement" name="Implement">
<bpmn:extensionElements>
<autofac:agentTask
agent="implementation-engineer"
action="implement"
executionMode="agent_sandboxed"
sandboxProfile="repo-write"
purposeType="implementation"
policyTag="repo-change"
permissionLevel="read-write"
allowedTools="sandbox.file_write,sandbox.git">
<autofac:prompt>Implement the change described in {{input.body}}.</autofac:prompt>
</autofac:agentTask>
</bpmn:extensionElements>
</bpmn:serviceTask>| Attribute | Required | Notes |
|---|---|---|
agent | Yes | Agent id. Unknown ids run with a generic prompt. |
action | Yes | Drives behavior. Some deterministic actions skip the model. |
purposeType | Yes | Purpose label used by policy and risk. |
policyTag | Yes | Policy bucket used by the policy engine. |
environment | No | Example: ci, staging, production. |
requiresEvidence | No | CSV of required evidence items. |
executionMode | No | local, tool_sandboxed, or agent_sandboxed. |
sandboxProfile | No | offline, repo-read, repo-write, or deployment. |
permissionLevel | No | read-only, read-write, or full. |
allowedTools / deniedTools | No | CSV allow/deny lists narrowing the agent's tools. |
prompt, promptFile, autofac:prompt | No | Task instructions with run-context interpolation. |
includeAgentOutput / outputFrom | No | Include prior output in a pull request body. |
maxRetries, retryBackoffSeconds | No | Retry policy. |
Deterministic tool actions
These actions dispatch to the Tool Gateway without a model call:
github.read_issuegithub.create_branchgithub.create_pull_requestgithub.create_prgithub.request_reviewgithub.post_reviewcicd.trigger_deploy- registered
mcp.*tools
autofac:approvalTask
Use autofac:approvalTask on a BPMN userTask.
<bpmn:userTask id="Review" name="Code Review">
<bpmn:extensionElements>
<autofac:approvalTask purposeType="code_review" policyTag="human-code-review" />
</bpmn:extensionElements>
</bpmn:userTask>| Attribute | Required | Notes |
|---|---|---|
purposeType | Yes | Shown on approval cards and used for risk display. |
policyTag | Yes | Policy bucket for the approval boundary. |
The run pauses until a decision is posted to POST /api/approvals/{id}/decision.
autofac:externalEvent
Use autofac:externalEvent on a receiveTask or message intermediateCatchEvent.
<bpmn:intermediateCatchEvent id="WaitForMerge">
<bpmn:extensionElements>
<autofac:externalEvent
messageName="github.pull_request.merged"
correlationKeyTemplate="{{input.branch_name}}" />
</bpmn:extensionElements>
<bpmn:messageEventDefinition />
</bpmn:intermediateCatchEvent>| Attribute | Required | Notes |
|---|---|---|
messageName | Yes | Event type to wait for. |
correlationKeyTemplate | Yes | Templated key matched against the inbound event. |
Timers
An intermediate catch event with a BPMN timer event definition pauses the run for the configured duration.
Run-context variables
| Variable | Description |
|---|---|
{{input.*}} | Values seeded at run start. |
{{output.<NodeId>}} | Output of a prior step. |
{{event.*}} | Payload from a resumed external event. |
{{run_id}} | Current run id. |
{{step_id}} | Current step id. |
{{node_name}} | Current BPMN node name. |
{{agent_name}} | Current agent name. |
{{action}} | Current task action. |