Workflow Customization

Hello everyone, I want to create a custom workflow process for employee loan application whereby only a user that the applying employee reports to will be able to approve the application and move it along the workflow chain, currently workflow is by defined by role, i want to make it accessible to specific users.
Any help will be appreciated.

@Ebuka_Joseph_Akeru sounds like you’ve already read the docs and this should be a repeatable on any instance. Can you screen shot what you’ve tried and I’ll try to repeat it locally? Please don’t share actual employee names or loan amounts.

Thanks @tmatteson

Employee loan application,

Workflow showing transition states

HR manager users
I want to create a situation where Employee 2 (who employee 1 reports to) will receive an email notification and employee 3 will not.

Some vanilla ideas to try:

  1. Can Employee Two be an HR User but not an HR Manager? If that works for you, you’ll want to add that as a possible path in your workflow (so that both HR user and HR Manager can approve loans)
  2. I’m pretty sure you want a save and submit step so that an employee can come back to their loan application mid process if needed
  3. Be sure to add a canceled state so that the Employee or HR can cancel the loan application if needed.
  4. Consider adding a custom role for “Loan Approver” to separate this from other HR responsibilities, if that’s appropriate for your use case.
  5. The email notification you can set up with an email notification, though you may need to add a custom link field for user to the loan application. You could write a script that fetches the employee’s supervisor and populates their email into the custom field, but I think that’s probably not worth the effort.

Can we consider the possibility of extending the workflow functionality to include both individual users as well as roles as recipients of workflow actions and then have the ability to use a variable to reference a field in the doctype that the workflow is being defined for? e.g. {doc.reports_to}


Workflow Action is superb for remote approvals via email but currently, it is like a loose cannon! …Notifications are always getting sent to users who have no business with the document just because they have the same role as the creator and/or approver

It would be great to have this fixed!


How to set different workflows for different leave types and designations?

1 Like

I use custom field to manage this

Hi @doniafrizal

How? Can you please give an example?

Kind regards,

a) create 3 custom field, link, user:

  1. requestor name
  2. reviewer name
  3. approver name

b) create notification. refer to this restriction workflow action email
select reviewer / approver email for email recipient

Hi @doniafrizal

I think your suggested solution is for notifications not for workflow actions. Workflow actions have the advantage that users can approve/reject directly from the email


yes, you are correct sir. any request to fix this?

Yes, I created a Github issue some weeks ago:

Kind regards,

rmehta says devs pay attention to votes, so don’t overlook to upvote Let Us Make ERPNext a professional workflow alternative for real business use cases, your ideas count - #5 by clarkej

I am currently working with one of the community members adapting my workflow solution in his own hosted instance,so far the testing result is positive,planned to use it in production system soon.
I am trying to find another volunteer to try my solution.

1 Like

PR already closed, how to open it?

is it your solution client side scripting or need to server side?i want to try it if client side.

my solution involves both client and server side code change, for details please kindly check the relevant PR, if possible I can help you do the code change in you system as what I have done for the other community member

1 Like