> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/source-control.md).

# Source Control

Operations about source control

## Pull changes from the remote repository

> Requires the Source Control feature to be licensed and connected to a repository.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SourceControl","description":"Operations about source control"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"pull":{"type":"object","properties":{"force":{"type":"boolean"},"autoPublish":{"type":"string","enum":["none","all","published"],"default":"none","description":"Controls automatic workflow publishing after import:\n- `none`: Keep workflows in their local published state (default)\n- `all`: Publish all imported workflows\n- `published`: Publish only workflows that were published locally before import\n"}}},"pullResult":{"type":"array","items":{"$ref":"#/components/schemas/sourceControlledFile"}},"sourceControlledFile":{"type":"object","required":["file","id","name","type","status","location","conflict","updatedAt"],"properties":{"file":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["credential","workflow","tags","variables","file","folders","project","datatable"]},"status":{"type":"string","enum":["new","modified","deleted","created","renamed","conflicted","ignored","staged","unknown"]},"location":{"type":"string","enum":["local","remote"]},"conflict":{"type":"boolean"},"updatedAt":{"type":"string"},"pushed":{"type":"boolean"},"isLocalPublished":{"type":"boolean"},"isRemoteArchived":{"type":"boolean"},"parentFolderId":{"type":"string","nullable":true},"folderPath":{"type":"array","items":{"type":"string"}},"owner":{"type":"object","required":["type","projectId","projectName"],"properties":{"type":{"type":"string","enum":["personal","team"]},"projectId":{"type":"string"},"projectName":{"type":"string"}}},"publishingError":{"type":"string"}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."}}},"paths":{"/source-control/pull":{"post":{"tags":["SourceControl"],"summary":"Pull changes from the remote repository","description":"Requires the Source Control feature to be licensed and connected to a repository.","requestBody":{"description":"Pull options","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pull"}}}},"responses":{"200":{"description":"Pull result containing the list of files that were pulled from the remote repository.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pullResult"}}}},"400":{"$ref":"#/components/responses/badRequest"},"409":{"description":"Conflict due to uncommitted local changes or merge conflicts. The response body lists every file in the pull diff; files causing the conflict have `conflict: true` or `status: modified`. Retry with `force=true` to discard local changes.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pullResult"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/connect/n8n-api/source-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
