Source Control API
SourceControlClient manages git-based source control operations.
This handle currently exposes the public API pull operation. It is useful when you want to bring remote workflow and credential changes into the current n8n instance.
Access
const sourceControl = client.sourceControl();
Methods
Common Tasks
- pull changes from the configured remote repository
- force a pull when you intentionally want to discard local changes
- publish imported workflows automatically after pull
pull(data)
Pull changes from the remote source control repository.
const files = await client.sourceControl().pull({
force: false,
autoPublish: 'published',
});
// files is SourceControlledFile[]
If n8n reports a conflict, inspect the returned files and look for conflict: true or statuses that indicate modified content.