iflytek/astron-agent · error · CustomException

VARIABLE_POOL_SET_PARAMETER_ERROR

VARIABLE_POOL_SET_PARAMETER_ERROR

Error message

Node name: {node.node_id}, error message: {err}

What it means

When a node's custom return / fail-branch result is written back into the workflow variable pool, any exception raised while setting variables is wrapped as VARIABLE_POOL_SET_PARAMETER_ERROR, carrying the node id and the original message. It indicates the node produced output that could not be stored in the variable pool (wrong keys, incompatible structure, etc.).

Solutions

  1. Read the inner 'error message' in err_msg to find the exact variable that failed to set
  2. Align the node's output_keys with what the node execution actually returns
  3. Re-export/upgrade the workflow DSL so variable names and types match current engine expectations
  4. Add a code/fail branch to handle nodes that may not produce all declared outputs

Example fix

// before
output_keys: ["result", "trace_id"]  # trace_id never produced by node
// after
output_keys: ["result"]
Defensive patterns

Strategy: try-catch

Validate before calling

# before running, confirm declared output keys exist in the node result
missing = [k for k in output_keys if k not in run_result.outputs]
if missing:
    raise ValueError(f"node {node_id} missing outputs: {missing}")

Try / catch

try:
    pool.set(node_id, output_keys, run_result)
except CustomException as e:
    logger.error("variable pool set failed for node %s: %s", node_id, e.err_msg)
    route_to_fail_branch(node_id, e)

Prevention

When it happens

Trigger: A node's run_result declares output keys whose values cannot be set into the variable pool (e.g. missing key, wrong type, pool schema mismatch); _create_custom_return_result or _create_fail_branch_result handling a node whose variable-set call throws.

Common situations: Custom-return node configured to output a variable the upstream nodes never produce; workflow DSL edited by hand so output_key names no longer match; iteration/branch nodes returning unexpected shapes after a version upgrade.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/0e8b1fabe20e0b44. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/dsl_engine.py:411

            },
            node_id=node.node_id,
            alias_name=node.node_alias_name,
            node_type=node.node_type,
        )

        # Update variable pool
        output_json = {**run_result.outputs, **run_result.error_outputs}
        output_keys = list(output_json.keys())

        try:
            await workflow_engine_ctx.variable_pool.add_variable(
                run_result.node_id,
                output_keys,
                run_result,
                span=span,
            )
        except Exception as err:
            raise CustomException(
                err_code=CodeEnum.VARIABLE_POOL_SET_PARAMETER_ERROR,
                err_msg=f"Node name: {node.node_id}, error message: {err}",
                cause_error=f"Node name: {node.node_id}, error message: {err}",
            ) from err

        # Handle special logic for streaming nodes
        await self._handle_stream_node_error_output(
            node, workflow_engine_ctx, run_result
        )

        # Callback for node end
        await workflow_engine_ctx.callback.on_node_end(
            node_id=node.node_id,
            alias_name=node.node_alias_name,
            message=run_result,
        )

        return run_result, False

View on GitHub (pinned to 5e758547a8)