Implement action confirm on Workflow action

Hi

This is suggestion feature from my team.

When we apply a workflow to a doctype, every workflow action appears inside the Action Button (as shown below).

The issue is that it’s easy to accidentally click on one of these actions. There’s no confirmation prompt, so if someone misclicks — for example, accidentally rejecting a document — the action is immediately executed without any chance to undo or confirm.

I found a possible solution on the Frappe forum using a client script to trigger before_workflow_action, which helps mitigate the issue.
Ref: I want to show a dialog box for confirm after each actiion by workflow

However, what if we could configure this confirmation behavior directly within the workflow itself?

For example, when a user clicks Approve, a dialog could appear asking them to confirm the action before it’s applied.

This is related PR: feat: Add action confirm on Workflow by TheerayutEncoder · Pull Request #33439 · frappe/frappe · GitHub

Any comment or suggestion would be appreciated.

2 Likes

Thanks! This will help a lot in prevent user from click through by mistake.

@TheerayutEncoder I’d like to suggest adding an Action Confirmation at the Workflow Transition Levels . Since confirmation might not be needed for all workflow states, it would be great if we could have the option to customize the confirmation message using a Jinja template. This feature would really improve user experience by preventing accidental actions and would make the feature more versatile.

Thank you for your suggestion — I appreciate it and agree with your perspective about move it to Transition levels.

And I just move it in the PR.

However, I’m not quite clear on the necessity of customizing the confirmation message.

I have encountered cases where I have to provide Business Specific Confirmation message as pop up on Action confirmation and customization I suggested if anyone wants to show records attribute in confirmation message to make it more generic feature.

2 Likes

Yes, I also think it will be a good feature. But if user leave the message (jinja) blank, it should fall back to default message.