Skip to main content

createDetailsOutputNode

workflow.createDetailsOutputNode() Create a generic output node to convert the title, content, and icon into separate collapsible WorkflowOutputItem.

This node will still execute as a output standard node, so CLI, Desktop, server embed, and log replay will collect its items as user-visible output. Ideal for outputting long logs, debug information, structured JSON, executive summary, or optional instructions as independent folding blocks.

Signature

workflow.createDetailsOutputNode<Input = DetailsOutputInput, Output extends WorkflowPayload = DetailsOutputPayload>(
options?: DetailsOutputNodeOptions<Input, Output>,
): BaseNode<Input, Output>

Input

When options.resolve is not passed, the node reads from input by default:

FieldTypeDescription
titlestringThe title displayed in <summary>. Null values use "Details".
contentunknownFolding block body. Strings are output as-is Markdown; objects and arrays remain original JSON.
iconstringOptional icon. Can be a preset name or custom text.

Options

FieldTypeDescription
namestringThe node name. The default value is "output".
titlestring | (input, context) => unknownFixed or dynamic title. Priority is higher than input.title.
contentstring | (input, context) => unknownFixed or dynamic body. Priority is higher than input.content.
iconstring | (input, context) => unknownFixed or dynamic icon. takes precedence over input.icon.
resolve(input, context) => { title, content, icon? }Unified conversion of business input into folding block parameters.
format(payload, details, input, context) => OutputBusiness fields are appended to the default payload.
historyLimitnumberThe number of nodes retained in the execution history. The default value is 50.
metadataWorkflowNodeMetadataInputThe node displays the meta information. The default type is details-output.

Icon Presets

PresetOutput
info[i]
success[ok]
warning[!]
error[x]
note[note]
code[code]
list[list]
quote[quote]
noneEmpty String

If the passed-in icon is not a preset name, it will be placed on the left side of the title as custom text.

Return to payload

Default payload inheritance WorkflowPayload:

FieldDescription
errCode0 on success.
errMessageEmpty string on success.
itemsContains only one collapsible item.

Default item structure:

{
id: string;
title: string;
icon: string;
iconPreset?: DetailsOutputIconPreset;
content: unknown;
contentType: "markdown" | "text" | "json" | "audio";
collapsed: true;
}

Objects and arrays remain in content and are automatically marked as contentType: "json"; strings are rendered as markdown by default.

Example: Direct transfer of title/content/icon

const detailsNode = workflow.createDetailsOutputNode();

const output = await workflow.runNode(detailsNode, {
title: "Click to expand",
icon: "info",
content: [
"This content is collapsed.",
"",
"- List item",
"- **Bold text**",
"- `Code`",
].join("\n"),
}, context);

return output;

If you want to expose a runnable example in the Desktop or server Run workspace,executor params should directly correspond to these 3 fields:icon uses the control: "radio" and preset icon options, and title / content uses normal string input. The workspace/workflow/details-output example takes this form to avoid masking the input to the details output node itself with a demo branch like scenario.

Example: Generating a folding block from business input

const debugNode = workflow.createDetailsOutputNode<DebugResult>({
name: "output",
title: "Debug payload",
icon: "code",
content(input) {
return {
status: input.status,
durationMs: input.durationMs,
warnings: input.warnings,
};
},
});

The example keeps details.content as a JSON object and does not stringify it into a Markdown block of code in advance.

Attention

  • Do not declare multiple output nodes with the same configuration name in a workflow file; If you want to output multiple folding blocks, you can reuse the same createDetailsOutputNode instance multiple times runNode, and eventually report will collect each output as an independent item.
  • This node is a normal node and is executed using workflow.runNode(...); createOutputNode({ stream, format }) is still used when streaming output per chunk is required.