Workflow tool: object passed via `args` reaches the script as a JSON string (args.items → TypeError)
Environment
Claude Code CLI, model claude-fable-5, Workflow (multi-agent orchestration) tool.
Repro
Invoke the Workflow tool with a script that reads args.items and pass a genuine JSON object in the tool call's args parameter:
Workflow({ script: "...const items = args.items; pipeline(items, ...)", args: {"items": [ {...}, {...} ] } })
Observed
The script's args global is the JSON-encoded string, not the parsed object. args.items is undefined and the run dies instantly:
TypeError: pipeline() expects an array as the first argument
The failure notification's recovery hint shows args re-serialized as a string, and the same happens on a fresh (non-resume) run.
Expected
Per the tool's own docs ("Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list breaks args.filter/args.map"), an object-valued args should arrive parsed.
Workaround
Defensive parse at the top of every script:
const parsedArgs = (typeof args === 'string') ? JSON.parse(args) : args
Suggested fix
Parse args once at script-launch when it is a string that parses as JSON, or serialize/deserialize consistently so the script always sees the structured value.