Surface document and artifact variables in the prompt variable pickers

Add the run input-documents variable to the workflow builder's variable
dropdown (workflow input) and the artifact-by-id lookup to both the workflow
builder and the agent prompt builder, so the variables exposed by the shared
template namespaces are discoverable. agent.input_documents is workflow-only
(injected from run state) and stays out of the agent builder, which would
render it empty.
This commit is contained in:
Alex committed 2026-06-25 09:17:40 +01:00
1 parent cdc0a0220d
commit 0d6c873358
3 files changed
+16 -1

No files matched your search

@@ -62,6 +62,11 @@ const GLOBAL_CONTEXT_VARIABLES: WorkflowVariable[] = [
templatePath: 'system.user_id',
section: 'Global context',
},
{
label: 'artifacts.artifact(id)',
templatePath: 'artifacts.artifact(id)',
section: 'Global context',
},
];
function toAgentTemplatePath(variableName: string): string {
@@ -109,6 +114,11 @@ function extractUpstreamVariables(
templatePath: 'agent.chat_history',
section: 'Workflow input',
},
{
label: 'agent.input_documents',
templatePath: 'agent.input_documents',
section: 'Workflow input',
},
...GLOBAL_CONTEXT_VARIABLES,
];
const seen = new Set(variables.map((variable) => variable.templatePath));
+2 -1
View File
@@ -932,7 +932,8 @@
"systemTime": "Current time (HH:MM:SS)",
"systemTimestamp": "ISO 8601 timestamp",
"systemRequestId": "Unique request identifier",
"systemUserId": "Current user ID"
"systemUserId": "Current user ID",
"artifactsLookup": "Artifact metadata by id"
},
"learnAboutPrompts": "Learn about Prompts →",
"publicPromptEditDisabled": "Public prompts cannot be edited",
@@ -89,6 +89,10 @@ const systemVariableOptionDefinitions = [
labelKey: 'modals.prompts.systemVariableOptions.systemUserId',
value: 'system.user_id',
},
{
labelKey: 'modals.prompts.systemVariableOptions.artifactsLookup',
value: 'artifacts.artifact(id)',
},
];
const buildSystemVariableOptions = (translate: (key: string) => string) =>