# Can't understand how approval workflow works

**URL:** <https://community.forestadmin.com/t/cant-understand-how-approval-workflow-works/6994>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [January 22, 2024, 3:13pm UTC](https://community.forestadmin.com/t/cant-understand-how-approval-workflow-works/6994 "2024-01-22T15:13:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matteo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/matteo/32/75_2.png) [@Matteo](https://community.forestadmin.com/u/Matteo)\
**Post date:** [January 22, 2024, 3:13pm UTC](https://community.forestadmin.com/t/cant-understand-how-approval-workflow-works/6994/1 "2024-01-22T15:13:16Z")

</div>

## Feature(s) impacted

Approval Workflow for Smart Actions

## Observed behavior

I can set the smart action permissions in order to have a role that MUST require approval:

 ![Screenshot 2024-01-22 at 16.07.00](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/c/c423ef93ccbbf826c91c3a5dc2df196424b970c1.png)

but **when the user triggers the smart action, it actually get immediately executed with no approval workflow**.

## Expected behavior

The Smart Action was supposed to trigger the approval workflow, as stated in this doc: [Manage roles and permission levels | User Guide](https://docs.forestadmin.com/user-guide/project-settings/teams-and-users/manage-roles#approval-workflow-permissions)

Am I doing something wrong? Any help would be greatly appreciated.

## Failure Logs

None  
The action just gets executed as no approval workflow was set up 🤷‍♂️

## Context

- Project name: Sailsquare
- Team name: Operations
- Environment name: STG-DATAMIX
- Other info (from `.forestadmin-schema.json` file:

```javascript
  "meta": {
    "liana": "forest-express-sequelize",
    "liana_version": "9.2.6",
    "stack": {
      "database_type": "postgres",
      "engine": "nodejs",
      "engine_version": "16.20.2",
      "orm_version": "6.28.0"
    }
  }

```

---

<div class="post-metadata">

**Author:** ![anon7311026](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@anon7311026](https://community.forestadmin.com/u/anon7311026)\
**Post date:** [January 22, 2024, 8:06pm UTC](https://community.forestadmin.com/t/cant-understand-how-approval-workflow-works/6994/2 "2024-01-22T20:06:52Z")

</div>

Hello @Matteo, and welcome back,

Would you be able to share some more details about the routes definition related to the smart action ?

Something that could cause the behaviour that you are seeing is failing to call the proper permission middlewares, as seen in [the example provided in the documentation](https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions).

If the issue persist, could you please share a minimal reproducible code (after removing any confidential information ). You may also send it as private message if you prefer.

Regards,

@anon7311026

---

<div class="post-metadata">

**Author:** ![Matteo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/matteo/32/75_2.png) [@Matteo](https://community.forestadmin.com/u/Matteo)\
**Post date:** [January 29, 2024, 11:38am UTC](https://community.forestadmin.com/t/cant-understand-how-approval-workflow-works/6994/3 "2024-01-29T11:38:43Z")

</div>

Hi @anon7311026  
Thank you for you support.  
With you hint, we realized that we didn’t call the forest middlewares correctly 😅

So, now problem (on our side) solved 👍

Thank you,  
Matteo
