Skip to main content

workflow-code structure

workflow-code structure does not execute the project. It first validates the complete package.json.workflowCode.projectInfo contract. Workflow and Conversation then read the script and report nodes, execution order, parameters, conversation configuration, and the debug registry; Kanban reads the artifact configuration in package.json, its HTML entry, and optional kanban.json.

Command Format

workflow-code structure [workflow-dir]

Parameter

ParameterDescription
workflow-dirworkflow project directory. Use the current directory when not passing.

output structure

FieldDescription
projectTypeItem type:workflow, conversation, or kanban. The first two are from executor; Kanban is from package.json.workflowCode.projectType.
artifactDirKanban Static product directory, default ..
entryKanban HTML entry relative to artifactDir, default index.html.
manifestList of optional v1 parameters for Kanban.
schedulePresetsWorkflow Proposed plan declared in package.json.workflowCode.schedulePresets and validated;Conversation and Kanban do not accept this field.
workflowworkflow name and underlying information.
definitions.nodesThe statically recognized node definition.
definitions.variablesStatically identified key variables.
executionThe derived execution structure comprises the runNode, runStreamNode, runIf, runFor, runWhile, runWorkflow, and question-classifier branches; return expressions such as return workflow.runNode(...), return workflow.runIf(...), and return workflow.runFor(...) are likewise incorporated into their respective branches or loops.
diagnosticswarnings, violations, and structural analysis errors.
paramsexecutor params declaration.
conversationexecutor conversation configuration.
registryexecutor registry declaration.

Failure behavior

SituationBehavior
Structural analysis successfulOutput structure JSON with exit code 0.
projectInfo contains unsupported fields or an invalid relationship declarationOutput structure JSON with the precise package-validation error and exit code 1.
Discovery Script Rule violationsOutput structure JSON containing diagnostics.error with exit code 1.
workflow File cannot be loadedOutput error structure JSON, exit code is 1.

Workflow/Conversation structural analysis requires that the source code contain a workflow.defineExecutor({ ... }) that can be read statically. Completely missing executor, passing dynamic variables to defineExecutor(config), missing or declaring unknown projectType, Workflow carrying Conversation configuration, and legacy conversation.enabled all produce violation with migration examples. Kanban is not required executor, but the type must be declared in the package and a configured, standard HTML entry point must be provided; absolute paths, directory traversal, symbolic links, reserved directories, and invalid kanban.json will result in an immediate error.

Example

workflow-code structure .
workflow-code structure workspace/workflow/hello
workflow-code structure workspace/workflow/runtime-timer
workflow-code structure ./roadmap-kanban

Suitable scenarios

SceneDescription
Debugging Desktop form parametersCheck if params is statically recognized.
Debugging single-node operationCheck if the target node exists in registry.
Check node orderLook at execution and definitions.nodes.
Check conditional branchLook at the if / else-if / else path for source: "run-if" in execution.
Check loop structureView the loop body’s children, condition, items, and maxIterations for source: "run-for" / source: "run-while" in execution.
Check workflow multiplexingView the child workflow invocation nodes of standardName: "run-workflow" in execution.
Check timing presetsConfirm that schedulePresets references an existing entrypoint, and that the time zone, time window, or 5-field Cron is valid for parameter JSON. CLI reports only on presets and does not create or execute schedules in the background.
Check KanbanConfirm projectType, artifactDir, entry, and optional manifest.params. Removed workflowCode.kanban.dataSources fails validation directly. Related projects now live in workflowCode.projectInfo.relatedProjects and are no longer returned as a Kanban structure field.