Skip to content

Custom PL/SQL logic tied to an Approval Routing step being approved (for example writing a custom History entry with the step's description) works for every step except the very last one, where looking up the current approval step throws an error.

Answer

This happens because, once the very last step of a routing has just been approved, there's no longer a genuine 'current' step for that routing to look up — calling a get-current-step-style API at that specific moment fails for exactly that reason. Use the equivalent get-previous-step-style API method instead, which reliably returns the step that was just approved whether or not it was the final one, rather than the get-current-step method, and the same custom logic works correctly across every step, including the final approval.

← Browse Workflows and automation questions