# Workflows

A workflow is a function within AG5 which allows admins to automatically notify their users (like employees, managers, etc.) about some of the changes in the system, such as when:

* Skills are missing or expiring soon
* New plannings have been made
* Master data changes have been made
* Skill actions resolved or waiting for approval
* Self assessments unsubmitted

Essentially, workflows are email notifications with a condition - what should happen when (such as when there's a missing skill requirement, for example).

In order to create a workflow in AG5, navigate to "Organisation" and then down to "Workflows".<br>

<figure><img src="/files/hHpcRNrtZIdkWOrrw5ot" alt=""><figcaption></figcaption></figure>

1. Click "**Create workflow configuration"**.
2. Name your workflow and click "Create".<br>
   1. We recommend leaving 'AG5' and '<noreply@ag5.com>' as the sender name and sender email address respectively. Any email address entered here will receive reply emails. Of course, feel free to replace those if so desired.
   2. The 'Required approval' box should be checked if you want to be able to grant approval before the workflow triggers. If you check this box, add the email address that should get this approval email in the 'email verification' field.
      1. If you don't want to approve every workflow triggered, ignore these.
3. **Add a trigger to the workflow.**

   A trigger is an instance where a workflow action (sending an email) is *triggered.* Basically, you're telling AG5 when you want an email sent, and in what context.\
   \
   Only **one** trigger can be added per workflow. Multiple workflows need to be created for multiple triggers.

   1. Scroll down to "Triggers" and click on "Add trigger”. Possible options include: 
      1. Required skill is missing
      2. Required/non-required skill is expiring soon
      3. Required skill is missing or expiring soon
      4. New planning
      5. Master data change request reviewed
      6. Master data change request waiting for approval
      7. Skill action resolved
      8. Skill action waiting for approval
      9. Self-assessment not submitted
   2. After choosing the necessary trigger, you need to choose which skill(s) will be used for the email notifications - there can be one skill or many. Click save when you're done. It's also possible to come back later and edit the trigger to add more skills.\ <br>

      <figure><img src="/files/cV9hXkZDzsfUkaXcxYfD" alt=""><figcaption></figcaption></figure>

   <br>
4. **Add an action to the workflow.**

   The action is the actual email alert. More than one action can be set up for a workflow. For example, you might set up one email alert for the employees themselves, as well as a second one for their direct manager, and a third for the training department.

   1. Move down the page and click on "**New action**". For action type, select "**Send email**" (the "API action" option is only used for integrations).
   2. At this point, you will want to consider who will get the email notification, and what kind of email you would like your users to receive.\
      \
      **IMPORTANT:** Employee user accounts must be attached to employee profiles containing email addresses in order to be recipients.
      1. First, choose the recipient of the email, which can either be the employee, their manager, or a specified email address (e.g. a training coordinator).
      2. Next, the subject and the body of the email must be created. When clicking in either field, both the subject and the body of the email can be personalised with the templates presented in this pop-up window, which auto populate text based the skill and employee:\
         \
         ![](https://cdn.elev.io/file/uploads/qkYqiBYxwTDWm05HcTy6vL9-Bt6vpySUOK3cwcx7jPo/Ze-kbzEcLMJ8OF_3t8LeYUB6hnsZP2kdhVI0k1hfu4g/Screenshot2024-09-30at114311-YWo.png)<br>
         1. Bear in mind, for those template fields to appear, the necessary information must be present in the system first.
      3. Finally, choose *when* the email should be sent (availability of employees can be changed in the employee portfolio).
         1. Always Run
         2. If employee is available
         3. If employee is not available
5. **Save the workflow action**

   &#x20;

   <figure><img src="/files/6aHjw9nkPGTbiuwuxiMQ" alt=""><figcaption></figcaption></figure>

   <br>
6. **Activate the workflow**
   1. Scroll up, click on the 3 dots next to "Edit" and select "Activate workflow".  The workflow is now fully functional and ready to be used after the message on top changes from Inactive to Active.
      1. Deactivation of a workflow is done in the same way.<br>

![](/files/GigpsdFo0yhczyFT2D0h)

\
An email will be sent to designated recipients each time the workflow's trigger is activated.&#x20;

> It's important to note that this will be a **separate** email for each instance the trigger fires. For example, let's say that a manager (who is set as a recipient) has 10 folks whose results will expire. That manager will then get 10 separate emails instead of a summary email.
>
> Please keep this in mind in order to avoid unintentionally spamming your recipients with notifications.&#x20;

All sent emails can be seen in the Organization > Sent Emails menu.

Questions? Ask your customer success manager or [AG5 customer support](mailto:support@ag5.com).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ag5.com/workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
