Adding AI to a workflow
Add a connector, build a translation step, bind it to a transition and test it.
On this page
This guide adds an AI step to the article workflow. A member takes a
Translate to Spanish transition, the article's body is translated,
and the article moves to a new translated status. Every step
requires the owner or admin role.
Before you start
You need an API key for a model provider: an OpenAI-compatible service, Anthropic, Mistral, or a service that accepts a plain JSON request.
The platform's included models do not need a key, but they serve only the wire jobs. To get a wire's text in Spanish with them, select the wire under Incoming wires, run Create article from wires and choose Spanish as the language. The included translation supports English, Swedish, Danish, Norwegian (Bokmål), Finnish, German, French and Spanish. The switches for this live under System settings > Account, in AI assistance when creating articles from wires. See Wires.
A workflow step needs a connector of your own.
1. Add a connector
- Open System settings > AI integrations.
- Choose New > Connector….
- Name it and pick the provider. The base URL is filled in for
known providers; change it for a self-hosted or proxy endpoint.
It must use
https://. - Paste the API key and create the connector.
The key is stored for your organisation and not shown again; to change it, open the connector and replace it.
2. Create the operation
- Choose New > AI operation.
- Under Start from, pick Translate text. Choose your connector and set Applies to to articles. Continue.
- In the editor, set Name to
Translate to Spanishand Reference name totranslate-to-spanish. The reference name is what the workflow points at, so pick a stable one. It must be unique in the organisation; the editor flags a name already in use, and the operation is not saved until it is changed. - Check Model under Sampling. It is pre-filled for the known providers, and any model the provider offers can be entered.
The preset asks the member for a target language each time, through an input called Translate to… that offers eight languages, Spanish among them, and records the choice as the article's language. Keep it if members should choose the language. For a fixed Spanish step:
- edit Instructions so that they say to translate into Spanish, in place of the reference to the picked language;
- remove the input under Inputs;
- under Output targets, remove the target that writes the picked language, and keep the one that patches the body.
Leave Output schema as it is unless you also change the targets. Under Safety, consider a limit on calls per hour and a cooldown per document.
3. Test it
Choose Test invoke, pick an existing article and run. The dialog shows the model's answer, or the error, without changing the article. A test run sends no input values, which is one reason a fixed language is easier to test.
When the answer looks right, choose Promote to usable. The button
stays disabled, with the reason shown, until the name, reference
name, instructions, model and output schema are all set. Only usable
operations can be bound to a workflow.
4. Bind it to a transition
- Open Workflows and then the workflow your articles follow.
- Use Add status to add a status named
translated. Optionally add a second one, such astranslation-failed, for failed runs. - Under the
draftstatus, use Add transition. Set Title toTranslate to Spanish. - Under AI operation, pick Translate to Spanish. Only
usableoperations for the workflow's document type are listed. - Set On success to
translated. Optionally set On failure totranslation-failed. Keep On success at a status where a person reads the translation, such astranslated; see Publishing the answer directly. - Under Required roles, list the roles that may run it, or leave it empty for every member.
- Add a transition out of
translated, such as back todraft, so that articles can move on.
The change applies at once to every article that follows this workflow.
Open a draft article and pick Translate to Spanish from its
status menu. The article locks with a banner while the AI works, then
arrives at translated with its body in Spanish. The translation is
added to the article's AI record and the article's AI label turns on;
the AI-assisted chip in the article footer shows both, and lets
an editor hide or show the label. See The AI label and the AI
record.
Publishing the answer directly
Setting On success to usable or withheld publishes the AI's
answer with no person reading it first. This is refused unless an
admin turns on AI publishing without review under System
settings > Account:
- while it is off, the workflow editor shows a notice on the step and the workflow is not saved until On success is changed;
- while it is on, the editor notes that the step publishes without
review, and each article published this way carries
meta.publishedWithoutReview, an AI label that cannot be hidden, and a disclosure on the public site, until a member publishes it.
A step that publishes directly is usually better split in two: the AI
step ends at a status such as translated, and a Publish
transition from there is taken by a person.
5. See failures
Open the operation under System settings > AI integrations. The Invocations section at the bottom lists every run, grouped per trigger, with its status, who triggered it, the request, the response and the error.
- Retry runs the operation again against the article as it is now.
- Skip moves the article on to
translatedwithout the AI's answer.
While a run is pending, a member can cancel it from the banner on the article. A run that is neither finished nor cancelled is cleared after 10 minutes.
If the answer does not fit the schema, the article moves to the
On failure status when one is set. Every other failure leaves it
at draft with nothing written, and unlocks it at once. In place of
the banner, the article shows a note naming the failed step and the
reason. Members who manage AI integrations can Retry or Skip
from the note; anyone else can pick Translate to Spanish again
from the status menu. See AI integrations for
the full failure model.