n8n_source_control_status
Check Git repository status in n8n workflows to monitor branch, remote sync, and merge conflicts for automation management.
Instructions
Get the current source control (Git) status.
Returns:
branchName: Current branch
connected: Whether Git is connected
ahead: Commits ahead of remote
behind: Commits behind remote
conflicts: Any merge conflicts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/users-sourcecontrol.ts:171-187 (handler)The handler function that executes the 'n8n_source_control_status' tool by fetching the status from the n8n API.
async () => { const status = await get<N8nSourceControlStatus>('/source-control/status'); const text = [ `**Source Control Status**`, `- Branch: ${status.branchName}`, `- Connected: ${status.connected ? '✅ Yes' : '❌ No'}`, `- Commits Ahead: ${status.ahead}`, `- Commits Behind: ${status.behind}`, status.conflicts?.length ? `- Conflicts: ${status.conflicts.join(', ')}` : '' ].filter(Boolean).join('\n'); return { content: [{ type: 'text', text }], structuredContent: status }; } - src/tools/users-sourcecontrol.ts:150-170 (registration)Registration of the 'n8n_source_control_status' tool within the server instance.
// ============ Get Source Control Status ============ server.registerTool( 'n8n_source_control_status', { title: 'Get Source Control Status', description: `Get the current source control (Git) status. Returns: - branchName: Current branch - connected: Whether Git is connected - ahead: Commits ahead of remote - behind: Commits behind remote - conflicts: Any merge conflicts`, inputSchema: EmptySchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } },