Documentation › Use an Artifact in a Process
Use an Artifact in a Process
You have an Artifact (templates and their questions) and a Process (a flow of steps). All that remains is to connect them: a step of the process will have the document generated by the person who carries it out, who first answers the artifact's questions.
The principle
The connection happens in two stages: you set up the step once, in the process; the assigned person then generates the document, for every process instance.
While designing
In the process step (Document, Email, Meeting, Task), you add a Generate document attachment, pick an Artifact's template and how it is used: as an attachment, or as the body of the email, meeting or task.
While running
The assignee clicks Generate and answers the artifact's questionnaire: their answers (and the process instance's variables) fill in the template's placeholders. They then save the task.
1. In the process: set up the Document step
- Open your process
Processes tab › the Edit pencil on the process's row.
- Add (or open) a Document step
Drag the Document step onto the grid, or double-click the existing one. In Properties, name it and choose the assigned people (Assigned to).
- Go to the Attachments tab
Click Add attachment, then Generate document. A "Generated from a template" card appears.
- Choose how it is used
If the step has a body (email, meeting, task), the Use the document as list offers An attachment or The body of the email (of the meeting, of the task). A document in a Document step is always an attachment.
- Choose the Artifact
In the Artifact field, select the Artifact that will fill in the document. It is the one that asks the questions at run time.
- Choose one of this Artifact's templates
The Template of the Artifact field becomes active and only offers the chosen Artifact's templates. An Artifact can have several (a Word contract, an HTML summary…): to generate several documents with the same Artifact, add one Generate document attachment per template. For a body, only .html, .htm and .txt templates are offered. The File name field defaults to the template's name: type your own to name the generated file differently (the template's extension is added if you forget it). For a body there is no file, so no name. If you change the Artifact, the chosen template is forgotten.
- Save and publish
Click Save in the panel, then Publish in the top bar.
Document — Documents handled by this step
Document — Documents handled by this step
Document — Documents handled by this step
A step can have several attachments: repeat Add attachment to generate several documents, or to mix them with fixed files.
2. In the process instance: generate the document
Once the process is published and a process instance started, the Document step becomes a task for the assigned person.
- Open the task
From the My tasks page, click the task's row (You should prepare the document). The task opens.
- Click Generate
In a Document task, the Generate button is in the toolbar (a menu lists each document if there are several). In an Email, Meeting or Task task, select the document's row in the attachments, then click Generate; for a body, the Generate body button is in the toolbar.
- Answer the questionnaire
A panel opens with the artifact's questions: text, number, date, choice list… Questions that depend on an answer appear once you have given it. The panel's Generate button stays greyed out until every required question (marked with a star) has an answer.
- Generate, then save
The generated file gets the name shown in the attachment's File name column: you can change it before clicking, even if you have not saved the task. Click Generate: the template's
{{Name}}placeholders are replaced by your answers and by the process instance's variables. The Document generated message (or Body generated: the text is then written into the body) confirms it. Click Save to keep the result in the task.
My tasks
3 assigned to you, sorted by due dateGenerate Employment contract
Between the company ProcNest and Marie Dupont,
hired on a permanent contract starting November 3.
3. Reuse the document in another task
A document generated (or uploaded) in one task can be used in other tasks: the email that sends it, the meeting that presents it, another task that completes it.
- Generate and save
In the task that produces the document, click Generate then Save. Until the task is saved, other tasks cannot see the document.
- Open the task that uses it
For example the Email task. In the attachments list, click Add attachment then Use document.
- Choose the documents
The Use a document window lists the documents from the process instance's other tasks, along with the name of the task that produced them. Tick the documents to use, one by one, or tick the task name to take all its documents at once (handy when a Document task holds several files), then click Use N documents and Save. Every ticked file is attached to the task.
When the email is sent with Send, its attachments (generated documents, uploaded files or reused documents) go with it.
In a meeting, attachments remain viewable in ProcNest: they are not added to the invitation sent by Office 365.
Other ways to add a document to a step
The Add attachment menu offers three options in the process:
| Option | When to use it |
|---|---|
| Generate document | The document depends on the process instance's variables: it is produced from a template. |
| Upload new attachment | The file is the same for everyone (charter, regulations…). You can drag and drop several files. |
| Upload later | A file has to be provided by the assigned person (for example a signed contract). Enter the expected name in File name. |
In a running process instance, the task's Add attachment menu offers Upload file and Use document (see above). For a generated document, a yellow Not generated tag marks it until it is generated, then it turns green Generated; an uploaded file carries a green Uploaded tag. A document taken from another task with Use document follows the original document: green Generated or Uploaded once it has its file, yellow Not generated otherwise. To generate, select its row then click Generate in the attachments bar.
Checklist before publishing
- The artifact has at least one template, every
{{placeholder}}matches a variable (see an artifact's variables) and its questions are published. - The Document step has someone in Assigned to.
- The chosen template is the right one, with a clear file name.
- The process is published (not just saved as a draft).