Restart approval workflow after rejection

Wade Clairmont
Tera Guru

I have a workflow that executes when a record state changes to requested, then processes approvals in sequence depending on approval limits, and can be rejected at any interval.

 

On rejection, the workflow currently sets the record approval stage to rejected and resets the state to draft.

 

After this, I require the ability to re-submit the record for approval again, but the workflow doesn't re-execute after the rejection, even when the state changes to requested again, which should match the workflow condition.

 

I do require the historical approvals from the previous workflow to remain for audit in the approval list view, but need the new approvals to show as they are generated.

 

Thoughts?

Thanks in advance.

1 REPLY 1

Chai Maddula
Giga Guru

Try using a Subflow
1. Update Workflow Condition: Keep it as current.state == 'requested' AND add a flag like re_submitted == true

2. On Rejection:

Set state = draft

Set a flag ready_for_resubmit = true

Keep the existing approvals for audit

 

3. When User Resubmits:

In your resubmit UI action or logic:

Set state = requested

Set re_submitted = true

Manually start a new workflow using startFlow(workflow_name, current)

 

Script could be like this

var wf = new Workflow();
wf.startFlow('your_workflow_name', current, current.operation(), current.sys_id);

 

I believe by this way, new approvals are generated, and the old ones remain in sysapproval_approver for audit.