workflow.LoadYAML compiles one version-1 descriptor into the same graph used by the Go builder. YAML is trusted application configuration: it can select tool calls, HTTP destinations, and JavaScript code.
Define a graph
Supply named dependencies
Withdescriptor as bytes, connector as an agents.MCPClient, and httpClient configured:
Dependencies.Agents, a map of workflow.AgentRunner. Each runner implements Run(context.Context, *agents.AgentInput) (*agents.AgentOutput, error). MCP and agent names come from application configuration, not automatic registry lookup.
Unknown fields, unknown dependencies, invalid expressions, duplicate IDs, unsupported versions, cycles, and invalid built-in ports are rejected. Keep validation at startup so malformed definitions do not first fail during a user request.
Expressions
A whole scalar${{ expression }} evaluates JavaScript and preserves the result’s JSON type. The expression must occupy the whole value; use a JavaScript template literal or concatenation to build strings.
For application data stored at
RunContext.context, use context.context.<key>. Expressions operate on copies; they do not mutate run state. JavaScript code nodes use a function body with return; if/else conditions are boolean expressions.
Limits
Dependencies.JavaScriptTimeout defaults to one second per evaluation. MaxResponseBytes defaults to 4 MiB for API responses. Goja runs in-process: the timeout and call-stack limit are not a process or heap sandbox. Do not accept arbitrary public YAML as trusted executable configuration.
See built-in nodes for individual fields, ports, and Go constructors.