Repository navigation
Description
Problem Statement
When running workflows with multiple steps or steps that produce large outputs, the executeActionNode internalAction fails with:
Error: Uncaught Error: Arguments for workflow/nodes.js:executeActionNode are too large (actual: 18.56 MiB, limit: 16 MiB)
Convex actions have a strict 16 MiB argument size limit. The workflow engine currently passes the entire execution state (including accumulated outputs from all previous steps) as arguments to each action node, causing this limit to be exceeded.
Current State
The workflow engine accumulates all step outputs in a steps object that grows with each executed step:
Step 1 → steps = { step1: {output: ...500KB...} }
Step 2 → steps = { step1, step2: {output: ...2MB...} }
...
Step N → steps object exceeds 16 MiB → ERROR
In execute_step_by_type.ts, the buildVariablesForAction() function only trims loop nesting but passes the full steps object unchanged to every action call.
Actions that commonly produce large outputs:
crawler_action: Web page content, HTML, extracted textdocument_action: Document content and metadataconversation_action: Full conversation historyrag_action: Search results with document chunks
Proposed Solution
Implement a lazy loading pattern for step outputs:
- Exclude full step outputs from action arguments - Pass only step metadata (type, slug, status)
- Store large step outputs separately - Use Convex storage for outputs exceeding threshold
- Provide on-demand access - Actions that need previous step data fetch it explicitly via helper function
This mirrors the existing pattern in serialize_variables.ts that stores large variables in Convex storage.
Affected Components
-
convex/workflow/helpers/step_execution/execute_step_by_type.ts- Trim steps from action args -
convex/workflow/helpers/step_execution/build_steps_map.ts- Add minimal steps builder -
convex/workflow/helpers/serialization/serialize_step_output.ts- New: step output storage -
convex/workflow/helpers/step_execution/get_step_output.ts- New: on-demand fetcher -
convex/workflow/helpers/step_execution/persist_execution_result.ts- Integrate step storage -
convex/workflow/actions/*- Review for steps dependency
Acceptance Criteria
- Workflows with 10+ steps producing large outputs execute without argument size errors
- Step outputs remain accessible to actions that need them via helper function
- Workflow UI still displays step outputs correctly
- No regression in existing workflow functionality
- Backwards compatible with in-progress workflow executions
🤖 Generated with Claude Code
Activity
larryro commentedon Jan 11, 2026
Implementation Plan
Step 1: Add Step Output Storage Helper
Create a helper to store large step outputs in Convex storage and return a reference.
New file:
convex/workflow/helpers/serialization/serialize_step_output.tsStep 2: Create Minimal Steps Map Builder
Modify
build_steps_map.tsto add a companion function that returns minimal step references:Step 3: Enhance
buildVariablesForActionto Exclude StepsModify:
execute_step_by_type.tsStep 4: Add Step Output Query Function
New file:
convex/workflow/helpers/step_execution/get_step_output.tsStep 5: Update Actions That Need Previous Step Data
Review and update actions that depend on
variables.steps[stepSlug].output:getStepOutput()helperStep 6: Preserve Full Steps for Persistence
The
stepsmap with full outputs should still be persisted (via storage serialization) for:Only the action arguments should be trimmed.
Files to Modify
convex/workflow/helpers/step_execution/execute_step_by_type.tsbuildMinimalStepsMap(), updatebuildVariablesForAction()to trim stepsconvex/workflow/helpers/step_execution/build_steps_map.tsconvex/workflow/helpers/serialization/serialize_step_output.tsconvex/workflow/helpers/step_execution/get_step_output.tsconvex/workflow/helpers/step_execution/persist_execution_result.tsconvex/workflow/actions/*variables.stepsdependenciesPotential Risks
variables.stepsdirectlyTesting Strategy
Unit Tests
serializeStepOutputcorrectly stores and references large outputsbuildVariablesForActionproduces arguments under 16 MiBgetStepOutputretrieves correct dataIntegration Tests
Edge Cases
🤖 Generated with Claude Code
fix: exclude full step outputs from action arguments to prevent 16 Mi…