Tidenda

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

  1. Open System settings > AI integrations.
  2. Choose New > Connector….
  3. 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://.
  4. 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

  1. Choose New > AI operation.
  2. Under Start from, pick Translate text. Choose your connector and set Applies to to articles. Continue.
  3. In the editor, set Name to Translate to Spanish and Reference name to translate-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.
  4. 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

  1. Open Workflows and then the workflow your articles follow.
  2. Use Add status to add a status named translated. Optionally add a second one, such as translation-failed, for failed runs.
  3. Under the draft status, use Add transition. Set Title to Translate to Spanish.
  4. Under AI operation, pick Translate to Spanish. Only usable operations for the workflow's document type are listed.
  5. Set On success to translated. Optionally set On failure to translation-failed. Keep On success at a status where a person reads the translation, such as translated; see Publishing the answer directly.
  6. Under Required roles, list the roles that may run it, or leave it empty for every member.
  7. Add a transition out of translated, such as back to draft, 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 translated without 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.