Set up a Workflow
set_up_workflowSet up the Workflow preview_workflow_setup proposed: pass the same arguments plus its previewHash. Publishes the definition as version 1 and creates a translation memory unless one was named. Refused when anything changed since the preview (WORKFLOW_PREVIEW_STALE, with the fresh preview), and when a Workflow already holds the repository (WORKFLOW_REPOSITORY_CLAIMED) or the Chatwoot portal (WORKFLOW_PORTAL_CLAIMED), so a retry never creates a second one. A GitLab Workflow registers a project hook through its connection, which takes a Maintainer: refused WORKFLOW_DEFINITION_INVALID (gitlab_hook_registration_failed) when GitLab refuses it — connect GitLab as a Maintainer of the repository, then try again. Starts no run: start_workflow_run does, once the user agrees to spend credits. With custom patterns, namespaceClashes lists each pattern whose wildcard gives several source folders the same namespace name; it is advisory and never makes a setup unready. Offer the user suggestedPattern where there is one, and change the patterns only if they accept: never apply it silently. Refused with GITHUB_RATE_LIMITED (503) when GitHub throttled the installation: wait details.retryAfterSeconds, then retry. When referring to a project or language in your reply to the user, use its name and locale (e.g. "French (fr-FR)") — ids (UUIDs) are for tool calls only, never show them to the user.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"previewHash": "<previewHash>"
},
"name": "set_up_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Default: the repository’s `owner/repo`, or its GitLab `pathWithNamespace`. | |
| import | No | What the first run does with translations already in the target files: `ignore` (default) translates every string afresh and writes over them; `reviewed` or `translated` imports them at that status. | |
| branches | No | Watched branches, in order; detection reads the first. Default: the repository’s default branch. | |
| chatwoot | No | Set up a Chatwoot Workflow instead: a connection (list_chatwoot_connections) and one of its portals. With it, pass no repository argument; `name`, `targetLanguages` and `translationMemoryId` apply as for a repository. | |
| patterns | No | Patterns in place of detection’s. With them, no `patterns` need is answered: a setup may sit on a branch with no locale files yet. | |
| provider | No | `github` (the default) or `gitlab`. A GitLab repository takes `connectionId` (list_gitlab_connections) and `repository` (list_gitlab_repositories) in place of `installationId`. | |
| repository | No | GitHub: `owner/repo`, any case. GitLab: the project’s numeric id or its `pathWithNamespace` (list_gitlab_repositories). Required for either. | |
| previewHash | Yes | The previewHash preview_workflow_setup answered | |
| connectionId | No | A GitLab connection of the organisation (`id` of `GET /api/gitlab/connections`); it must be `active`, from list_gitlab_connections. Required for a GitLab repository. | |
| installationId | No | GitHub’s numeric App installation id (`installationId` of `GET /api/github/installations`); it must be this organisation’s. Required for a GitHub repository. | |
| sourceLanguage | No | In place of the detected source; respelled to the language catalog’s spelling. | |
| targetLanguages | No | Declared targets in place of the detected ones, taken as given. | |
| translationMemoryId | No | An existing translation memory of the organisation (404 `TRANSLATION_MEMORY_NOT_FOUND` otherwise). Absent, confirm creates one named after the Workflow. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| name | Yes | ||
| active | Yes | Whether its Input’s connection is healthy: a GitHub Input’s credentials, a Contentful Input’s space linked to this organisation, or a Chatwoot Input’s connection `connected`. An inactive Workflow starts no runs. | |
| archived | Yes | ||
| createdAt | Yes | ||
| takeovers | Yes | ||
| updatedAt | Yes | ||
| archivedAt | Yes | ||
| description | Yes | ||
| currentVersion | Yes | ||
| namespaceClashes | Yes | The custom `patterns` whose wildcard matches several source folders that all get the same namespace name, over the files of the branch detection read; empty without custom `patterns`. Advisory: setup is unaffected and each folder is still its own namespace. Offer the user suggestedPattern (it changes the Workflow, so never apply it silently) | |
| createdTranslationMemory | Yes | The translation memory setup created; `null` when the body named one |