diff --git a/src/components/Executions/ExecutionDetails/test/RelaunchExecutionForm.test.tsx b/src/components/Executions/ExecutionDetails/test/RelaunchExecutionForm.test.tsx index 3d89b3710..55488e26f 100644 --- a/src/components/Executions/ExecutionDetails/test/RelaunchExecutionForm.test.tsx +++ b/src/components/Executions/ExecutionDetails/test/RelaunchExecutionForm.test.tsx @@ -185,6 +185,44 @@ describe('RelaunchExecutionForm', () => { }); }); + describe('Launch form with full inputs', () => { + let values: LiteralValueMap; + beforeEach(() => { + workflowInputDefinitions = { + workflowSimpleString: mockSimpleVariables.simpleString, + workflowSimpleInteger: mockSimpleVariables.simpleInteger + }; + workflow.closure!.compiledWorkflow!.primary.template.interface!.inputs = { + variables: workflowInputDefinitions + }; + executionInputs = { + literals: { + workflowSimpleString: primitiveLiteral({ + stringValue: simpleStringValue + }), + workflowSimpleInteger: primitiveLiteral({ + integer: simpleIntegerValue + }) + } + }; + executionData.fullInputs = executionInputs; + execution.closure.computedInputs = executionInputs; + values = createValuesMap(workflowInputDefinitions, executionInputs); + }); + it('correctly uses fullInputs when value is present and does not call getRemoteLiteralMap()', async () => { + delete execution.closure.computedInputs; + const { getByText } = renderForm(); + await waitFor(() => getByText(mockContentString)); + expect(mockGetExecutionData).toHaveBeenCalledWith(execution.id); + expect(mockGetRemoteLiteralMap).not.toHaveBeenCalled(); + checkLaunchFormProps({ + initialParameters: expect.objectContaining({ + values + }) + }); + }); + }); + describe('with single task execution', () => { let values: LiteralValueMap; let authRole: Admin.IAuthRole; diff --git a/src/components/Executions/useWorkflowExecution.ts b/src/components/Executions/useWorkflowExecution.ts index 262ed5014..568b72fc8 100644 --- a/src/components/Executions/useWorkflowExecution.ts +++ b/src/components/Executions/useWorkflowExecution.ts @@ -73,7 +73,17 @@ export const fetchWorkflowExecutionInputs = async ( if (execution.closure.computedInputs) { return execution.closure.computedInputs; } - const { inputs } = await getExecutionData(execution.id); + /** Note: + * getExecutionData will retun signed urls (`inputs`) as well as raw values + * (`fullInputs`) if input payload isn't too large. + * + * If a signed URL is returned `fullInputs` will be null; use `fullInputs` + * when available. + */ + const { inputs, fullInputs } = await getExecutionData(execution.id); + if (fullInputs) { + return LiteralMap.create(fullInputs); + } if ( !inputs.url || !inputs.bytes ||