Skip to main content

0.8.0

Trace file capture through the workflow journal. AgentClientStep now propagates trace file paths from the underlying agent model into the workflow’s StepTransition and journal events. This closes the gap between “the agent ran” and “here’s exactly what the agent did” — every tool call, token count, and thinking block is preserved in a JSONL trace file, and the path to that file is recorded in the workflow journal.

AgentClientStep trace wiring

When the backing AgentClient implementation returns a trace path via executeForResult(), AgentClientStep writes it to AgentContext.TRACE_PATH and the executor propagates it through to StepTransition.tracePath():
// Trace-aware client bridges agent-client to workflow-flows
AgentClient traceClient = new AgentClient() {
    @Override
    public String execute(String prompt, AgentContext ctx) {
        return executeForResult(prompt, ctx).text();
    }

    @Override
    public ExecutionResult executeForResult(String prompt, AgentContext ctx) {
        AgentClientResponse response = coreClient.run(prompt);
        String tracePath = (String) response.getMetadata().get("tracePath");
        return new ExecutionResult(response.getResult(), tracePath);
    }
};

AgentClientStep step = AgentClientStep.of(traceClient, "Fix the bug: {input}");
In a multi-step workflow, each AI step gets its own trace file. Deterministic steps pass through with no trace. Analysis scripts iterate over journal events to find all trace files for a run:
Workflow: remediate
  step: trivy-scan       → tracePath: null (deterministic)
  step: claude-fix       → tracePath: /traces/fix-20260528-143000.jsonl
  step: mvn-test         → tracePath: null (deterministic)
  step: claude-verify    → tracePath: /traces/verify-20260528-143500.jsonl

What changed

  • AgentClient.executeForResult() — new default method returning ExecutionResult(text, tracePath). Backward compatible: lambdas still work, trace path is null.
  • AgentClientStep — calls executeForResult(), writes TRACE_PATH to context via updateContext()
  • StepTransition and WorkflowStepEvent — carry optional tracePath field
  • JdbcTraceRecorder — new trace_path column in step_transitions table
  • AgentContext.TRACE_PATH — new well-known context key
  • AgentContext.Builder.without() — remove a key from context (used internally to clear per-step trace paths)
  • ClaudeStep javadoc — now recommends AgentClientStep for experiments needing trace capture
See Trace Capture for the full guide.

0.7.0

Managed Agents as a step runtime. The new ManagedAgentStep delegates workflow steps to Anthropic’s Managed Agents API. The workflow graph stays in charge — but specific steps can run in Anthropic’s cloud sandbox with full tool access (bash, file I/O, web search). This proves the core thesis: workflow is portable, execution substrate is pluggable. The same workflow definition can run steps locally, via Temporal, or in Anthropic’s hosted infrastructure — swap a single step, zero changes to the graph.

ManagedAgentStep

Reference a pre-created agent and environment:
ManagedAgentStep step = ManagedAgentStep.of(agentId, environmentId)
    .name("remediation-agent")
    .timeout(Duration.ofMinutes(10));

String result = step.execute(ctx, "Fix the failing test in AuthService.java");
Or provision a new agent inline with the default toolset:
ManagedAgentStep step = ManagedAgentStep.create(
    "claude-sonnet-4-6",
    "You are a code remediation agent. Fix failing tests.",
    environmentId);
Use it in a workflow like any other step:
var workflow = WorkflowGraph.builder()
    .step("analyze", analyzeStep)
    .step("remediate", ManagedAgentStep.of(agentId, envId).name("fix"))
    .step("validate", validateStep)
    .build();
Design choices:
  • Uses the official com.anthropic:anthropic-java SDK directly — no wrapper layer
  • Follows the A2AStep immutable pattern: factory methods, copier methods for name() / timeout(), SessionRunner functional interface for testability
  • One session per execute() call — agents are reused, sessions are ephemeral
  • Stream-first SSE pattern: opens the event stream before sending the user message, collects agentMessage text blocks, breaks on sessionStatusIdle or sessionStatusTerminated
Dependency (optional — only needed if you use ManagedAgentStep):
<dependency>
    <groupId>com.anthropic</groupId>
    <artifactId>anthropic-java</artifactId>
    <version>2.34.0</version>
</dependency>

Step runtime landscape

With 0.7.0, Agent Workflow supports five step runtimes:
StepRuntimeUse case
Steps.of(fn)Local JVMDeterministic logic, API calls
ChatClientStepSpring AISingle LLM call, structured output
ClaudeStepClaude CLIQuick scripts (no trace capture)
AgentClientStepagent-clientFull agent loop with trace capture
A2AStepA2A protocolRemote agent delegation
ManagedAgentStepAnthropic cloudHosted agent with sandbox

0.6.0

Initial public release on Maven Central. See Getting Started and the Tutorial.