Describe the bug
I was trying to build off the experimental/gadgets-subagents and examples/workflows to combine them. I basically wanted a sub agent to kick off and own a workflow.
I had an AgentWorkflow named FlightSearchWorkflow and a TripPlannerAgent parent agent.
I defined a FlightSearchAgent and had code like this in a method:
async runFlightSearch(task: string) {
console.log("Running flight search workflow...");
const instanceId = await this.runWorkflow("FLIGHT_SEARCH_WORKFLOW", { task });
console.log("Started flight search workflow with instanceId:", instanceId);
// ...
}
It never got to the second log, instead it threw an error:
Could not detect Agent binding name from class name. Pass it explicitly via options.agentBinding
To Reproduce
Steps to reproduce the behavior:
- Create and export an
AgentWorkflow that does a step
- Create an
Agent
- Create a subagent with a
doSomething method that calls this.runWorkflow and export it
- In the parent agent, call
this.subAgent to get it
- Invoke the
doSomething method
- See error
(Assuming all Wrangler setup is there)
Expected behavior
Subagents should be able to a workflow AgentFlow functionality the same way a top-level Agent does.
Version:
0.11.4
Additional context
"dependencies": {
"@cloudflare/ai-chat": "*",
"@cloudflare/kumo": "^1.19.0",
"@phosphor-icons/react": "^2.1.10",
"agents": "^0.11.4",
"ai": "^6.0.168",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"workers-ai-provider": "^3.1.11"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.33.1",
"@cloudflare/workers-types": "^4.20260422.1",
"@tailwindcss/vite": "^4",
"@types/node": "^25.6.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"tailwindcss": "^4.2.2",
"vite": "^8.0.9"
}
Describe the bug
I was trying to build off the experimental/gadgets-subagents and examples/workflows to combine them. I basically wanted a sub agent to kick off and own a workflow.
I had an
AgentWorkflownamedFlightSearchWorkflowand aTripPlannerAgentparent agent.I defined a
FlightSearchAgentand had code like this in a method:It never got to the second log, instead it threw an error:
To Reproduce
Steps to reproduce the behavior:
AgentWorkflowthat does a stepAgentdoSomethingmethod that callsthis.runWorkflowand export itthis.subAgentto get itdoSomethingmethod(Assuming all Wrangler setup is there)
Expected behavior
Subagents should be able to a workflow AgentFlow functionality the same way a top-level Agent does.
Version:
0.11.4
Additional context