/ Search

Search Epistola

Find documentation, integration guides, tour steps, blog posts and pages.

DocsIntegrationsTourBlogPage
↑↓↵esc

Work in progress — The Learn section is being expanded; alpha, beta, and preview capabilities are labelled where relevant.
← Back to Learn

Connect to Valtimo

Let Valtimo generate an Epistola document at the right step in a case.

integrationvaltimo

Connect to Valtimo

Use the Valtimo plugin when a case process should generate an Epistola document on its own, at the step where the case needs it. Epistola builds the document from case data that is already in Valtimo. Nobody has to switch between systems.

Plugin 1.x works with Epistola Suite 2.x. Upgrade the Suite and the plugin together.

What the plugin adds

You configure the plugin per Epistola tenant, with:

  • the base URL;
  • an API key of an application in Epistola, with the roles Viewer (Content Viewer) and Generator (Document Generator);
  • the tenant to work in;
  • optionally, a default environment.

The plugin also adds four actions you can place on a process step:

  • Generate Document submits a generation request for a template you choose.
  • Generate Dynamic Document submits a letter that was chosen while the process ran, usually by an employee in a letter composer.
  • Check Job Status checks the status of a request separately.
  • Download Document fetches the finished PDF and makes it available to the process.

Steps

  1. Configure the Epistola connection in Valtimo.
  2. Make sure the catalog with the template is published. If cases use an environment, deploy the release there.
  3. Add the Generate Document action to the step that needs the document.
  4. Select the environment, the catalog, the template and the variant.
  5. Map the case information to the document fields.
  6. Save the process and run it with a realistic case.

Choosing a release

Epistola always generates from a published release of a catalog. Which release depends on the environment:

  • With an environment, Epistola uses what you deployed to that environment. A case then gets only what you chose to deploy.
  • Without an environment, Epistola uses the highest published release.

An action can also ask for a version or a range, such as ^1.4.0. Epistola then uses the highest release that fits. Environments are the recommended way to control what a case process gets.

Choosing a variant

A template can have several variants: the same content in a different language, channel, or house style. You have three options:

  • Leave the variant out. Epistola then uses the template’s default.
  • Name a variant when the process knows exactly which presentation it needs.
  • Describe the variant by attributes and let Epistola pick the one that matches the case.

You cannot combine naming a variant with describing one by attributes.

Mapping the case data

The mapping is a JSONata expression. It reads the case data as $doc and the process variables as $pv. It has to return an object that matches the template’s data contract: the same fields the template expects to receive.

Work from the contract, not from the document you have in mind. The template renders whatever the contract describes.

The document is not ready immediately

Generation is asynchronous. As soon as Epistola accepts the request, the action stores the request id in the process variable you chose, with the status PENDING. But the PDF does not exist yet at that point.

Give the process a wait step after generation that waits for Epistola’s completion message. Then route the process on the outcome. A later step that assumes the document is already there will carry on without it.

Epistola can refuse a request straight away, for example when the template is not in the release. Mark the generate step Asynchronous before: the refusal then becomes an incident that says what is missing. Rendering can also fail later, after Epistola accepted the job. Then the result has the status FAILED. Handle both: the incident and the failed job.

Keep the split clear

Use Valtimo to decide when a document is needed and which case data goes in. Use Epistola to decide what the document contains and looks like: the template, the variant, and the theme. Keep layout and wording in Epistola, and process logic in Valtimo.

More on this topic

Epistola is open source, not free of cost. The organisations that use it fund its development, through Epistola or an Official Partner. We are steward-owned: fair prices, no profit maximisation. How Epistola is funded →