From 30bd25716bb7dd7bd6503fe2d8fc82274137207f Mon Sep 17 00:00:00 2001 From: PentaFDevs <149094373+PentaFrame-Development@users.noreply.github.com> Date: Fri, 16 Jan 2026 09:50:53 +0100 Subject: [PATCH] Fix PDF Generator output variables not appearing in subsequent agent steps (#12619) This commit fixes multiple issues preventing PDF Generator (Docs Generator) output variables from being visible in the Output section and available to downstream nodes. ### What problem does this PR solve? Issues Fixed: 1. PDF Generator nodes initialized with empty object instead of proper initial values 2. Output structure mismatch (had 'value' property that system doesn't expect) 3. Missing 'download' output in form schema 4. Output list computed from static values instead of form state 5. Added null/undefined guard to transferOutputs function ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Changes: - web/src/pages/agent/constant/index.tsx: Fixed output structure in initialPDFGeneratorValues - web/src/pages/agent/hooks/use-add-node.ts: Initialize PDF Generator with proper values - web/src/pages/agent/form/pdf-generator-form/index.tsx: Fixed schema and use form.watch - web/src/pages/agent/form/components/output.tsx: Added null guard and spacing --- web/src/pages/agent/constant/index.tsx | 8 ++++---- .../pages/agent/form/components/output.tsx | 7 +++++-- .../agent/form/pdf-generator-form/index.tsx | 19 ++++++++++--------- web/src/pages/agent/hooks/use-add-node.ts | 3 ++- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/web/src/pages/agent/constant/index.tsx b/web/src/pages/agent/constant/index.tsx index 869f247c0..4904a5985 100644 --- a/web/src/pages/agent/constant/index.tsx +++ b/web/src/pages/agent/constant/index.tsx @@ -1016,10 +1016,10 @@ export const initialPDFGeneratorValues = { watermark_text: '', enable_toc: false, outputs: { - file_path: { type: 'string', value: '' }, - pdf_base64: { type: 'string', value: '' }, - download: { type: 'string', value: '' }, - success: { type: 'boolean', value: false }, + file_path: { type: 'string' }, + pdf_base64: { type: 'string' }, + download: { type: 'string' }, + success: { type: 'boolean' }, }, }; diff --git a/web/src/pages/agent/form/components/output.tsx b/web/src/pages/agent/form/components/output.tsx index 73058b67b..e428c4651 100644 --- a/web/src/pages/agent/form/components/output.tsx +++ b/web/src/pages/agent/form/components/output.tsx @@ -14,7 +14,10 @@ type OutputProps = { isFormRequired?: boolean; } & PropsWithChildren; -export function transferOutputs(outputs: Record) { +export function transferOutputs(outputs: Record | undefined) { + if (!outputs) { + return []; + } return Object.entries(outputs).map(([key, value]) => ({ title: key, type: value?.type, @@ -35,7 +38,7 @@ export function Output({
{t('flow.output')} {children}
-