Infer function input in workflow step (#8308)

- add `inputSchema` column in serverless function. This is an array of
parameters, with their name and type
- on serverless function id update, get the `inputSchema` + store empty
settings in step
- from step settings, build the form 

TODO in next PR:
- use field type to decide what kind of form should be printed
- have a strategy to handle object as input



https://github.com/user-attachments/assets/ed96f919-24b5-4baf-a051-31f76f45e575
This commit is contained in:
Thomas Trompette
2024-11-05 14:57:06 +01:00
committed by GitHub
parent d1531aa1b6
commit be8141ce5e
29 changed files with 334 additions and 90 deletions

View File

@ -9,7 +9,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
import { UserAuthGuard } from 'src/engine/guards/user-auth.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { WorkflowBuilderService } from 'src/modules/workflow/workflow-builder/workflow-builder.service';
import { WorkflowBuilderWorkspaceService } from 'src/modules/workflow/workflow-builder/workflow-builder.workspace-service';
import { OutputSchema } from 'src/modules/workflow/workflow-executor/types/workflow-step-settings.type';
@Resolver()
@ -17,7 +17,7 @@ import { OutputSchema } from 'src/modules/workflow/workflow-executor/types/workf
@UseFilters(WorkflowTriggerGraphqlApiExceptionFilter)
export class WorkflowBuilderResolver {
constructor(
private readonly workflowBuilderService: WorkflowBuilderService,
private readonly workflowBuilderWorkspaceService: WorkflowBuilderWorkspaceService,
) {}
@Mutation(() => graphqlTypeJson)
@ -25,7 +25,7 @@ export class WorkflowBuilderResolver {
@AuthWorkspace() { id: workspaceId }: Workspace,
@Args('input') { step }: ComputeStepOutputSchemaInput,
): Promise<OutputSchema> {
return this.workflowBuilderService.computeStepOutputSchema({
return this.workflowBuilderWorkspaceService.computeStepOutputSchema({
step,
workspaceId,
});