Skip to content

BPMN Extensions ​

Agentwerke runs standard BPMN 2.0 with extension elements in the namespace:

text
https://agentwerke.de/bpmn/extensions/v1

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

xml
<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>
AttributeRequiredNotes
agentYesAgent id. Unknown ids run with a generic prompt.
actionYesDrives behavior. Some deterministic actions skip the model.
purposeTypeYesPurpose label used by policy and risk.
policyTagYesPolicy bucket used by the policy engine.
environmentNoExample: ci, staging, production.
requiresEvidenceNoCSV of required evidence items.
executionModeNolocal, tool_sandboxed, or agent_sandboxed.
sandboxProfileNooffline, repo-read, repo-write, or deployment.
permissionLevelNoread-only, read-write, or full.
allowedTools / deniedToolsNoCSV allow/deny lists narrowing the agent's tools.
prompt, promptFile, autofac:promptNoTask instructions with run-context interpolation.
includeAgentOutput / outputFromNoInclude prior output in a pull request body.
maxRetries, retryBackoffSecondsNoRetry policy.

Deterministic tool actions ​

These actions dispatch to the Tool Gateway without a model call:

  • github.read_issue
  • github.create_branch
  • github.create_pull_request
  • github.create_pr
  • github.request_review
  • github.post_review
  • cicd.trigger_deploy
  • registered mcp.* tools

autofac:approvalTask ​

Use autofac:approvalTask on a BPMN userTask.

xml
<bpmn:userTask id="Review" name="Code Review">
  <bpmn:extensionElements>
    <autofac:approvalTask purposeType="code_review" policyTag="human-code-review" />
  </bpmn:extensionElements>
</bpmn:userTask>
AttributeRequiredNotes
purposeTypeYesShown on approval cards and used for risk display.
policyTagYesPolicy 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.

xml
<bpmn:intermediateCatchEvent id="WaitForMerge">
  <bpmn:extensionElements>
    <autofac:externalEvent
      messageName="github.pull_request.merged"
      correlationKeyTemplate="{{input.branch_name}}" />
  </bpmn:extensionElements>
  <bpmn:messageEventDefinition />
</bpmn:intermediateCatchEvent>
AttributeRequiredNotes
messageNameYesEvent type to wait for.
correlationKeyTemplateYesTemplated key matched against the inbound event.

Correlating a wait with a CI build ​

A key the workflow author has to invent up front — {{input.build_id}} — only matches if something downstream happens to produce that exact value. For a wait on a build that Agentwerke itself dispatches, key it on the run instead:

xml
<autofac:externalEvent messageName="test.unit.completed"
                       correlationKeyTemplate="{{run_id}}" />

cicd.trigger_deploy with correlate defaults its correlation key to the same run id and passes it to the workflow as agentwerke_correlation_key. The CI job echoes that value back when it reports its result, so both sides agree on the key without either guessing.

A run can hold only one external wait at a time, so the run id alone is sufficient to identify it.

examples/ci/agentwerke-verify.yml is the CI half of this contract — a reference GitHub Actions workflow to copy into the dispatched repository. It declares the inputs the dispatch sends (without which GitHub rejects the whole call with 422 "Unexpected inputs provided"), runs the tests, and posts the signed result back to POST /webhooks/events. Note that it reports the result before failing on a red build: the report is what resumes the waiting run, so failing first would leave the run waiting for a callback that never arrives.

Timers ​

An intermediate catch event with a BPMN timer event definition pauses the run for the configured duration.

Run-context variables ​

Available in prompts and in correlationKeyTemplate:

VariableDescription
{{input.*}}Values seeded at run start.
{{output.<NodeId>}}Output of a prior step, as its raw text.
{{event.*}}Payload from a resumed external event.
{{run_id}}Current run id.

Available in prompts only — these describe the executing task, which an external wait has no notion of:

VariableDescription
{{step_id}}Current step id.
{{node_name}}Current BPMN node name.
{{agent_name}}Current agent name.
{{action}}Current task action.

An unresolved variable is left as-is rather than blanked, so a typo shows up in the rendered value instead of silently producing an empty key.

Apache-2.0 open core. Enterprise-only capabilities are labeled in context.