code-steps

Preview Code Step

Run Python code in the same sandbox path as a workflow code step (no workflow execution).

Sync handler so run_code_preview (sandbox + user code) runs in FastAPI's thread pool instead of blocking the asyncio event loop.

post/workflow/code-steps/preview

Request

  • Base URL
    https://api.anyreach.ai (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Headers

x-anyreach-orgstring nullable

Organization ID for user PATs (pat_ prefix tokens)

Request body

codestring required

Python function body for the code step

packagesstring[] nullable

pip packages to install before run; defaults to service default

context_dataobject

Workflow JSONata context (WorkflowContext.data) for preview

step_idstring

Step id used for ctx.current_step_id and recorded outputs

Response

Successful Response

statusstring required

SUCCESS or FAILURE

outputunknown
errorstring nullable

Step-level error message

stdoutstring
stderrstring
execution_errorstring nullable

Interpreter/sandbox error string if any

Changes

No recorded changes to this operation across all 1 revision of this API.