Skip to main content

Produce documents with workflows

Use a workflow definition as the app's executable capability. For a writing app, a single run can gather context, generate content, create a document, log the result, and finish.

workflowDefinitions: {
writePost: resources.workflow({
title: 'Write a social post',
desiredState: 'active',
definition: {
version: 1,
default_runner: 'builtin',
steps: [
nodes.call('generate', 'content.generate-written-content@1', {
prompt: '{{ input.prompt }}',
}),
nodes.call('create-document', 'documents.create-document@1', {
folderId: ref('documentFolders', 'drafts'),
title: '{{ outputs.generate.title }}',
content: '{{ outputs.generate.content }}',
}),
],
},
}),
}

Node availability and parameter schemas come from the target server. Query GET /api/v1/apps-layer/platform-schema instead of assuming every server has the same workflow-node catalog.

One output, several surfaces

Bind the same document folder to:

  • chat as outputDocumentFolder
  • a document surface for editing and review
  • the content scheduler for publishing

This creates a continuous experience without duplicating document data or editor behavior.