Visualize workflow run step input (#10677)

- Compute the context the selected step had access to during its
execution and display it with the `<JsonNestedNode />` component
- Ensure several steps with the same name can be displayed in order
- Prevent access to the input tab in a few cases
- Hide the input tab when the trigger node is selected as this node
takes no input
- Hide the input tab when the selected node has not been executed yet or
is currently executed
- Fallback to the Node tab when the Input tab can't be accessed

## Successful workflow execution


https://github.com/user-attachments/assets/4a2bb5f5-450c-46ed-b2d7-a14d3b1e5c1f

## Failed workflow execution


https://github.com/user-attachments/assets/3be2784e-e76c-48ab-aef5-17f63410898e

Closes https://github.com/twentyhq/core-team-issues/issues/433
This commit is contained in:
Baptiste Devessier
2025-03-06 17:49:10 +01:00
committed by GitHub
parent 9d78dc322d
commit cb5f4820d7
22 changed files with 12943 additions and 74 deletions

View File

@ -181,7 +181,7 @@ const workflowExecutorOutputSchema = z.object({
error: z.string().optional(),
});
const workflowRunOutputStepsOutputSchema = z.record(
export const workflowRunOutputStepsOutputSchema = z.record(
workflowExecutorOutputSchema,
);
@ -195,11 +195,18 @@ export const workflowRunOutputSchema = z.object({
error: z.string().optional(),
});
export const workflowRunSchema = z.object({
__typename: z.literal('WorkflowRun'),
id: z.string(),
workflowVersionId: z.string(),
output: workflowRunOutputSchema.nullable(),
});
export const workflowRunContextSchema = z.record(z.any());
export type WorkflowRunOutput = z.infer<typeof workflowRunOutputSchema>;
export const workflowRunSchema = z
.object({
__typename: z.literal('WorkflowRun'),
id: z.string(),
workflowVersionId: z.string(),
output: workflowRunOutputSchema.nullable(),
context: workflowRunContextSchema.nullable(),
createdAt: z.string(),
deletedAt: z.string().nullable(),
endedAt: z.string().nullable(),
name: z.string(),
})
.passthrough();