Translate Text
deepl.translate_text
ActionAI & modelsconnection required
Calls the DeepL API with the connection's credentials.
Translate one text, or a batch of up to 50, into a target language with optional formality, glossary, tag handling and context.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- DeepL
- Secret shape
- the DeepL auth key, or {"api_key": "…"}
- Resolved by
- config.connection_id, else node.connection_id
Configuration
16 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
text The text to translate. Give 'texts' instead to translate a batch in one call. | string | No | — | — | Hello, world |
texts Several texts to translate in one call, as a JSON array of strings. DeepL accepts up to 50 and answers with one translation per entry, in order. | array | No | — | array of string | — |
target_lang Language to translate into, as a DeepL code such as DE, FR, JA, EN-GB, EN-US, PT-BR or ZH-HANS. Run deepl.list_languages with type=target for the current list. | string | Yes | — | — | DE |
source_lang Language of the input, as a DeepL code such as EN, DE or JA. Leave empty to let DeepL detect it; required when a glossary is used. | string | No | — | — | — |
formality Whether the translation leans formal or informal. 'more'/'less' are refused with a 400 for a target language that does not support formality — DeepL documents support for DE, ES, FR, IT, JA, NL, PL, PT-BR, PT-PT, RU. Use 'prefer_more'/'prefer_less' to fall back to the default formality instead of failing, and check supports_formality on deepl.list_languages (type=target) for the current set. | string | No | — | one of "default", "more", "less", "prefer_more", "prefer_less" | — |
glossary_id Glossary to apply, from deepl.create_glossary or deepl.list_glossaries. Its language pair must match, so source_lang has to be set when a glossary is used. | string | No | — | — | — |
context Surrounding text that gives DeepL context for the translation. It is not translated and is not billed. | string | No | — | — | — |
tag_handling Treat the input as markup and translate only its text nodes. | string | No | — | one of "xml", "html" | — |
split_sentences How the input is split into sentences: '0' not at all, '1' on punctuation and newlines (DeepL's default), 'nonewlines' on punctuation only. | string | No | — | one of "0", "1", "nonewlines" | — |
preserve_formatting Keep the original punctuation and capitalisation at the start and end of each sentence instead of correcting it. | boolean | No | — | — | — |
outline_detection Set false to turn off automatic detection of the document outline when splitting_tags and friends are given by hand. | boolean | Conditional | — | only with tag_handling | — |
non_splitting_tags Comma-separated tag names that never cause a sentence split. | string | Conditional | — | only with tag_handling | — |
splitting_tags Comma-separated tag names that always cause a sentence split. | string | Conditional | — | only with tag_handling | — |
ignore_tags Comma-separated tag names whose content is left untranslated. | string | Conditional | — | only with tag_handling | — |
model_type Which translation model to use: the classic latency-optimised one, the next-generation quality-optimised one, or the quality one where the language pair supports it. | string | No | — | one of "latency_optimized", "quality_optimized", "prefer_quality_optimized" | — |
show_billed_characters Ask DeepL to report how many characters each translation was billed for. | boolean | No | — | — | — |
- At least one of text, texts must be set.
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"target_lang": "DE",
"text": "Hello, world"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
text The first translation, for the single-text case. | string | — |
texts Every translation, in the order the texts were sent. | array | — |
translations[].text One translated text. | string | — |
translations[].detected_source_language Language DeepL detected for that text. | string | — |
detected_source_language Language DeepL detected for the first text; empty when source_lang was set. | string | — |
target_lang Language the texts were translated into. | string | — |
count How many translations came back. | number | — |
billed_characters Characters billed across the batch; 0 unless show_billed_characters was set. | number | — |
{
"billed_characters": 0,
"count": 0,
"detected_source_language": "",
"target_lang": "",
"text": "",
"texts": [],
"translations": [
{
"detected_source_language": "",
"text": ""
}
]
}See Translate Text run in a workflow.
In a technical demo we add the DeepL connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.