Developer ToolsFree generatorPDF, Excel, Word exportOracle E-Business SuiteAll Oracle E-Business Suite tools

Oracle EBS Workflow Notifications and Errored Activity Query Generator

This generator produces the queries an Oracle EBS 12.1 or 12.2 workflow administrator runs every week: errored activities for an item type, open notifications for a user, the Notification Mailer backlog and the deferred queue. It also writes a PL/SQL block that checks an item's status and retries one errored activity through WF_ENGINE.

Fill in

For example POAPPRV (PO approval), REQAPPRV (requisition approval), OEOH (order header), OEOL (order line), WFERROR (error process).

Copy RETRY_ACTIVITY from query 1.

Generated code
Download:

1. Errored activities for the item type

SELECT ias.item_key,
       pa.process_name,
       pa.instance_label,
       pa.activity_name,
       ias.activity_status,
       ias.error_name,
       SUBSTR(ias.error_message, 1, 400) AS error_message,
       ias.begin_date,
       pa.process_name || ':' || pa.instance_label AS retry_activity
FROM   wf_item_activity_statuses ias
JOIN   wf_process_activities pa
       ON pa.instance_id = ias.process_activity
WHERE  ias.item_type = 'OEOL'
AND    ias.activity_status = 'ERROR'
AND    ias.item_key = NVL('[Item key (optional for queries, required for retry)]', ias.item_key)
AND    ias.begin_date >= SYSDATE - 7
ORDER  BY ias.begin_date DESC;

2. Open notifications for a user or role

SELECT n.notification_id,
       n.message_type,
       n.message_name,
       n.subject,
       n.begin_date,
       n.mail_status,
       n.original_recipient
FROM   wf_notifications n
WHERE  n.recipient_role = 'SYSADMIN'
AND    n.status = 'OPEN'
AND    n.begin_date >= SYSDATE - 7
ORDER  BY n.begin_date DESC;

3. Notification Mailer backlog

SELECT n.mail_status,
       COUNT(*) AS notifications
FROM   wf_notifications n
WHERE  n.status = 'OPEN'
AND    n.mail_status IN ('MAIL', 'FAILED', 'ERROR')
GROUP  BY n.mail_status
ORDER  BY 2 DESC;

4. Deferred activity backlog (Workflow Background Process)

-- WF_DEFERRED is an Advanced Queuing queue table; STATE 0 = ready, 1 = waiting (delayed), 2 = processed, 3 = expired
SELECT q.corrid,
       q.state,
       COUNT(*) AS messages,
       MIN(q.enq_time) AS oldest_enqueued
FROM   applsys.wf_deferred q
GROUP  BY q.corrid, q.state
ORDER  BY 3 DESC;

5. Check status and retry one errored activity

SET SERVEROUTPUT ON
DECLARE
  l_status VARCHAR2(30);
  l_result VARCHAR2(240);
BEGIN
  wf_engine.itemstatus(itemtype => 'OEOL',
                       itemkey  => '[Item key (optional for queries, required for retry)]',
                       status   => l_status,
                       result   => l_result);
  DBMS_OUTPUT.PUT_LINE('Before retry: ' || l_status || ' / ' || l_result);

  wf_engine.handleerror(itemtype => 'OEOL',
                        itemkey  => '[Item key (optional for queries, required for retry)]',
                        activity => 'PROCESS_NAME:INSTANCE_LABEL',
                        command  => 'RETRY',
                        result   => NULL);
  COMMIT;

  wf_engine.itemstatus(itemtype => 'OEOL',
                       itemkey  => '[Item key (optional for queries, required for retry)]',
                       status   => l_status,
                       result   => l_result);
  DBMS_OUTPUT.PUT_LINE('After retry: ' || l_status || ' / ' || l_result);
END;
/

Queries are read-only; block 5 changes workflow state, so run it in a test instance first and only after fixing the root cause of the error. Verify the WF_ENGINE signatures in the Oracle Workflow API Reference for your release, and that your item type uses the internal names shown in Workflow Builder. For order lines, prefer the Progress Order action or the Retry Activities in Error flow where your process allows it.

Send us a stuck workflow

Share the item type and the error text and we will tell you whether a retry, a skip or a data fix is the safe route.

Optional. The tool and every export work without this. No spam.

Was this tool useful?

How to use it

Set the item type internal name, an optional item key, the recipient role and how many days back to look. Run query 1 first: it lists every activity in ERROR status with the error name and message, and builds the RETRY_ACTIVITY string in the PROCESS_NAME:INSTANCE_LABEL form that WF_ENGINE.HANDLEERROR expects. Paste that value and the item key into the fields, review the root cause, then run block 5. Queries 2 to 4 are health checks: a growing MAIL count means the mailer is not sending, FAILED or ERROR rows point to bad addresses or mailer errors, and a large ready count in WF_DEFERRED means the Workflow Background Process is not scheduled for that item type.

Where this lives in Oracle EBS

Runtime state is in WF_ITEMS (one row per item type and key), WF_ITEM_ACTIVITY_STATUSES (current status of each activity instance, with history in WF_ITEM_ACTIVITY_STATUSES_H) and WF_PROCESS_ACTIVITIES (the design-time map from INSTANCE_ID to process name, activity name and instance label). Notifications are in WF_NOTIFICATIONS, keyed by NOTIFICATION_ID, with RECIPIENT_ROLE, STATUS (OPEN, CLOSED, CANCELED) and MAIL_STATUS. Deferred activities are messages in the APPLSYS.WF_DEFERRED queue table, picked up by the Workflow Background Process concurrent program. In the application, the same data is visible through Workflow Administrator Web Applications responsibility > Status Monitor, which also lets you retry, skip or rewind an activity.

Label versus name, and other gotchas

HANDLEERROR takes the activity label, not the activity name. Most activities have a label equal to the name, but a process that uses the same function twice gets labels such as APPROVE_PO and APPROVE_PO-1, so always take INSTANCE_LABEL from WF_PROCESS_ACTIVITIES. Prefix it with the process name when the label is not unique across subprocesses. RETRY re-executes the activity, so if the error came from data (a closed period, a missing account, an invalid approver) fix the data first or the activity errors again. SKIP with a result is the alternative when you have already completed the step manually. Always COMMIT after the call; the engine does not commit for you.

  • Deferred steps only move when the Workflow Background Process runs with Process Deferred = Yes for that item type.
  • Process Timeout and Process Stuck are separate parameters of the same program.
  • Purge Obsolete Workflow Runtime Data keeps these tables small; run it for closed items.

How to check the result

After the retry, block 5 prints the item status again. ACTIVE means the engine moved on; COMPLETE means the process ended; ERROR means the same or a new activity failed, so rerun query 1 for that item key. For notifications, a retried approval usually creates a new WF_NOTIFICATIONS row for the next approver; query 2 with that approver's user name confirms it was sent, and MAIL_STATUS moves from MAIL to SENT once the mailer delivers it. If the item belongs to an order line, Sales Orders > Actions > Progress Order should show the next eligible activity.

Frequently Asked Questions

Which API retries an errored workflow activity in Oracle EBS?

WF_ENGINE.HANDLEERROR(itemtype, itemkey, activity, command, result) with command 'RETRY' re-executes the activity; 'SKIP' with a result code skips it. The activity argument is the activity label, optionally prefixed with the process name as PROCESS:LABEL. Commit after the call. For bulk retries, the standard Retry Errored Workflow Activities concurrent program does the same for an item type.

How do I find the workflow for a notification ID?

Query WF_NOTIFICATIONS by NOTIFICATION_ID to get MESSAGE_TYPE, RECIPIENT_ROLE and STATUS, then join WF_ITEM_ACTIVITY_STATUSES on NOTIFICATION_ID to find the ITEM_TYPE and ITEM_KEY that sent it. With the item key you can open the item in Status Monitor or run query 1 of this tool for the full activity history.

Why are workflow notifications not being emailed?

Check query 3. A rising count with MAIL_STATUS = 'MAIL' means the Workflow Notification Mailer is down, not started or cannot reach the SMTP or IMAP server; check it in Oracle Applications Manager > Workflow Manager. FAILED or ERROR rows usually point to invalid email addresses or an excluded notification preference for that role.

What does the Workflow Background Process do?

It processes activities that were deferred (cost above the engine threshold or deferred by design), timed-out notifications and, optionally, stuck processes for a given item type. Order Management, Purchasing and many other products rely on it, so it is usually scheduled every few minutes for OEOL and OEOH. Query 4 shows the deferred queue it works from.

If your support team wants to ask which approvals are stuck and why in plain English, answered from your EBS workflow tables on your own servers, we can set that up.

ArchRay builder
Design the on-prem AI stack for Oracle E-Business Suite: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring

Free tools

ERP fixes and how-tos

Runs with your ERP

AI on your ERP

Integrations

Software