Files
n8n-mcp/dist/services/n8n-api-client.d.ts
Romuald Członkowski 47a1cb135d feat: implement transferWorkflow operation in n8n_update_partial_workflow (#644) (#649)
Add transferWorkflow diff operation to move workflows between n8n projects:
- TransferWorkflowOperation type with destinationProjectId field
- WorkflowDiffEngine validates and tracks transfer intent
- Handler calls PUT /workflows/{id}/transfer after update
- N8nApiClient.transferWorkflow() method
- Zod schema validates destinationProjectId is non-empty
- Tool description and documentation updated
- inferIntentFromOperations case for transfer

Also fixes two pre-existing bugs found during review:
- continueOnError path now properly extracts/propagates activation flags
- Debug log in updateConnectionReferences shows correct old name

Based on work by @djakielski in PR #645.


Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
2026-03-20 17:50:00 +01:00

50 lines
2.8 KiB
TypeScript

import { Workflow, WorkflowListParams, WorkflowListResponse, Execution, ExecutionListParams, ExecutionListResponse, Credential, CredentialListParams, CredentialListResponse, Tag, TagListParams, TagListResponse, HealthCheckResponse, N8nVersionInfo, Variable, WebhookRequest, SourceControlStatus, SourceControlPullResult, SourceControlPushResult } from '../types/n8n-api';
export interface N8nApiClientConfig {
baseUrl: string;
apiKey: string;
timeout?: number;
maxRetries?: number;
}
export declare class N8nApiClient {
private client;
private maxRetries;
private baseUrl;
private versionInfo;
private versionPromise;
constructor(config: N8nApiClientConfig);
getVersion(): Promise<N8nVersionInfo | null>;
private fetchVersionOnce;
getCachedVersionInfo(): N8nVersionInfo | null;
healthCheck(): Promise<HealthCheckResponse>;
createWorkflow(workflow: Partial<Workflow>): Promise<Workflow>;
getWorkflow(id: string): Promise<Workflow>;
updateWorkflow(id: string, workflow: Partial<Workflow>): Promise<Workflow>;
deleteWorkflow(id: string): Promise<Workflow>;
transferWorkflow(id: string, destinationProjectId: string): Promise<void>;
activateWorkflow(id: string): Promise<Workflow>;
deactivateWorkflow(id: string): Promise<Workflow>;
listWorkflows(params?: WorkflowListParams): Promise<WorkflowListResponse>;
getExecution(id: string, includeData?: boolean): Promise<Execution>;
listExecutions(params?: ExecutionListParams): Promise<ExecutionListResponse>;
deleteExecution(id: string): Promise<void>;
triggerWebhook(request: WebhookRequest): Promise<any>;
listCredentials(params?: CredentialListParams): Promise<CredentialListResponse>;
getCredential(id: string): Promise<Credential>;
createCredential(credential: Partial<Credential>): Promise<Credential>;
updateCredential(id: string, credential: Partial<Credential>): Promise<Credential>;
deleteCredential(id: string): Promise<void>;
listTags(params?: TagListParams): Promise<TagListResponse>;
createTag(tag: Partial<Tag>): Promise<Tag>;
updateTag(id: string, tag: Partial<Tag>): Promise<Tag>;
deleteTag(id: string): Promise<void>;
updateWorkflowTags(workflowId: string, tagIds: string[]): Promise<Tag[]>;
getSourceControlStatus(): Promise<SourceControlStatus>;
pullSourceControl(force?: boolean): Promise<SourceControlPullResult>;
pushSourceControl(message: string, fileNames?: string[]): Promise<SourceControlPushResult>;
getVariables(): Promise<Variable[]>;
createVariable(variable: Partial<Variable>): Promise<Variable>;
updateVariable(id: string, variable: Partial<Variable>): Promise<Variable>;
deleteVariable(id: string): Promise<void>;
private validateListResponse;
}
//# sourceMappingURL=n8n-api-client.d.ts.map