n8n
Version:
n8n Workflow Automation Tool
86 lines (85 loc) • 2.86 kB
TypeScript
import type { AuthenticatedRequest } from '@n8n/db';
import type { INode, IConnections, IWorkflowSettings, IRunData, ITaskData, IWorkflowBase, AiAgentRequest, IDestinationNode } from 'n8n-workflow';
import type { ListQuery } from '../requests';
export declare namespace WorkflowRequest {
type CreateUpdatePayload = Partial<{
id: string;
name: string;
description: string | null;
nodes: INode[];
connections: IConnections;
settings: IWorkflowSettings;
active: boolean;
tags: string[];
hash: string;
meta: Record<string, unknown>;
projectId: string;
parentFolderId?: string;
uiContext?: string;
expectedChecksum?: string;
aiBuilderAssisted?: boolean;
autosaved?: boolean;
}>;
type FullManualExecutionFromKnownTriggerPayload = {
workflowData: IWorkflowBase;
agentRequest?: AiAgentRequest;
destinationNode?: IDestinationNode;
triggerToStartFrom: {
name: string;
data?: ITaskData;
};
};
type FullManualExecutionFromUnknownTriggerPayload = {
workflowData: IWorkflowBase;
agentRequest?: AiAgentRequest;
destinationNode: IDestinationNode;
};
type PartialManualExecutionToDestinationPayload = {
workflowData: IWorkflowBase;
agentRequest?: AiAgentRequest;
runData: IRunData;
destinationNode: IDestinationNode;
dirtyNodeNames: string[];
};
type ManualRunPayload = FullManualExecutionFromKnownTriggerPayload | FullManualExecutionFromUnknownTriggerPayload | PartialManualExecutionToDestinationPayload;
type Create = AuthenticatedRequest<{}, {}, CreateUpdatePayload>;
type Get = AuthenticatedRequest<{
workflowId: string;
}>;
type GetMany = AuthenticatedRequest<{}, {}, {}, ListQuery.Params & {
includeScopes?: string;
includeFolders?: string;
onlySharedWithMe?: string;
availableInMCP?: string;
}> & {
listQueryOptions: ListQuery.Options;
};
type Update = AuthenticatedRequest<{
workflowId: string;
}, {}, CreateUpdatePayload, {
forceSave?: string;
}>;
type NewName = AuthenticatedRequest<{}, {}, {}, {
name?: string;
projectId: string;
}>;
type ManualRun = AuthenticatedRequest<{
workflowId: string;
}, {}, ManualRunPayload, {}>;
type Share = AuthenticatedRequest<{
workflowId: string;
}, {}, {
shareWithIds: string[];
}>;
type Activate = AuthenticatedRequest<{
workflowId: string;
}, {}, {
versionId: string;
name?: string;
description?: string;
expectedChecksum?: string;
}>;
type Deactivate = AuthenticatedRequest<{
workflowId: string;
}>;
}