Preview Workflow setup
preview_workflow_setupPreview setting up a Workflow that translates a GitHub repository, from the App installation id (list_github_installations) and "owner/repo" alone. Detects the locale files on the first branch and proposes a definition: Translate, then QA, delivered by pull request; the detected source and target languages; named "owner/repo". 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. 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": {
"installationId": "<installationId>",
"repository": "<repository>"
},
"name": "preview_workflow_setup"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Default: the repository’s `owner/repo`. | |
| 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. | |
| 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. | |
| repository | Yes | `owner/repo`, any case. Its numeric id is resolved through the installation. | |
| installationId | Yes | GitHub’s numeric App installation id (`installationId` of `GET /api/github/installations`); it must be this organisation’s | |
| 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 | ||
| newTranslationMemory | No | Whether confirm creates a translation memory, named after the Workflow |