Preview Workflow setup
preview_workflow_setupPreview setting up a Workflow. For a Chatwoot Help Center, pass chatwoot — a connection (list_chatwoot_connections) and one of its portals — alone: it proposes what the web builder starts from (the whole portal; its default locale as the source; every other locale it allows as a target, with discovery on; Translate, then QA; written back into the portal), named after the portal; ready: false with alreadySetUp when a Workflow holds the portal. Otherwise it translates a GitHub repository, from the App installation id (list_github_installations) and "owner/repo" alone; or, with provider: "gitlab", a GitLab repository from a GitLab connection (list_gitlab_connections) and the project’s id or path (list_gitlab_repositories). Detects the locale files on the first branch and proposes a definition: Translate, then QA, delivered by pull or merge request; the detected source and target languages; named after the repository. Writes nothing and starts no run. Answers ready: true with the definition, the file groups left out as unlikely (excludedGroups) and a previewHash for set_up_workflow; or ready: false with needs (each names what was found and the argument to pass — a language is never guessed), or with alreadySetUp naming the Workflow that holds the repository, whatever any Project on it does. Only when no Workflow holds it is it refused with REPOSITORY_HELD_BY_PROJECT, when a Project has work on it: continue on that Project. Pass the optional arguments to apply what the user asks for. 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
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "preview_workflow_setup"
}
}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. | |
| 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 |
|---|---|---|---|
| name | No | ||
| needs | No | One per field setup can’t fill | |
| ready | Yes | true: confirm with set_up_workflow and `previewHash`. false: `alreadySetUp` names the Workflow holding the repository, or `needs` lists what to pass | |
| warnings | No | ||
| takeovers | No | Idle Projects’ Repository rows on the repository, which the Workflow takes over | |
| definition | No | The definition confirm publishes as version 1. While `newTranslationMemory`, its translate Action names the stand-in `00000000-0000-4000-8000-000000000000`, which confirm replaces with the memory it creates. | |
| previewHash | No | Send it with `POST /api/workflows/setup`: refused with 409 `WORKFLOW_PREVIEW_STALE` when the definition, excluded groups, claims or warnings changed since | |
| alreadySetUp | No | The Workflow holding the repository: nothing to set up, whatever any Project on it does, and confirm is refused with 409 `WORKFLOW_REPOSITORY_CLAIMED` | |
| excludedGroups | No | ||
| namespaceClashes | No | 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) | |
| newTranslationMemory | No | Whether confirm creates a translation memory, named after the Workflow |