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.
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.
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.
Related Tools
Oracle EBS Order-to-Cash (O2C) SQL Generator: Order to Delivery to Invoice to Receipt
Build a query that follows each Order Management line through Shipping, Receivables invoicing and cash application in Oracle EBS R12.
OracleOracle EBS SQL for Concurrent Requests Generator
Build ready-to-run SQL for recent, running, pending and long-running concurrent requests from a few filter fields.
Developer ToolsOracle EBS Integrated SOA Gateway REST Service Call Generator (curl)
Generate working curl commands for a PL/SQL API deployed as a REST service through Oracle EBS 12.2 Integrated SOA Gateway, with the RESTHeader context.
OracleOracle EBS Patch Level, Applied Patches and Version SQL Generator
Generate the queries to find the EBS release, whether bugs are applied, recent patch runs, adop session status, 12.2 code levels and product patch levels.
More Developer Tools tools
See all- Oracle EBS Onhand Quantity SQL Generator
- Oracle EBS BOM Explosion SQL Generator
- Oracle EBS Pending Transactions SQL Generator for Period Close
- Oracle EBS Public PL/SQL API Reference (OM, INV, PO, AP, AR, TCA, FND)
- Oracle EBS Forms Personalization Tables and Trigger Events Reference
- Oracle EBS Forms FRM Error Codes Reference (FRM-92101, FRM-40735)
- Oracle EBS XML Publisher RTF Template Syntax Reference
- Oracle EBS OE_ORDER_PUB.PROCESS_ORDER Script Generator
- Oracle EBS FND_REQUEST.SUBMIT_REQUEST Code Generator
Keep exploring
Free tools
- Oracle EBS Workflow Notification Mailer Troubleshooting ChecklistA grouped checklist for EBS 12.1 and 12.2 when workflow notification emails stop going out, arrive late or responses are not processed.
- Oracle EBS Workflow Tables Reference (WF_ITEMS, WF_NOTIFICATIONS)The Oracle Workflow runtime, definition, directory and queue tables in EBS 12.1/12.2, with the columns you query to find errored and stuck items.
- Oracle EBS User and Responsibility Audit SQL GeneratorFill in a user and responsibility pattern and get ready-to-run queries for active user access, administrator access and duplicate access reviews.
ERP fixes and how-tos
- Fix Oracle EBS Workflow Notification Mailer Not Sending EmailsEBS Notification Mailer stuck on Suspended or Error usually means SMTP, IMAP, or TLS changed on the mail server. Fix the connection and clear the backlog.
- Oracle Workflow error: Attribute does not exist for item typeFix Oracle Workflow's Attribute does not exist for item type error in EBS by checking the item type's attribute definitions in Workflow Builder against every activity and message referencing it, including custom customizations.
- Fix Oracle EBS Order Lines Stuck in Awaiting ShippingOrder Management line stuck at Awaiting Shipping or another OEOL workflow step? Check Pick Release, deferred activities, the Workflow Background Process and retry the activity.
Runs with your ERP
- Esker Order Management and Oracle E-Business SuiteHow Esker captures customer POs from email, fax and PDF and creates sales orders in Oracle EBS: integration, data flows, setup, pitfalls and a private AI layer.
- Cloud Inventory (DSI) with Oracle E-Business Suite: Mobile Barcode InventoryCloud Inventory, formerly DSI, adds offline mobile barcode inventory to Oracle E-Business Suite and JD Edwards. Data flows, setup steps, pitfalls and AI notes.
- MarkView for Accounts Payable and Oracle E-Business SuiteHow Tungsten (Kofax) MarkView automates AP invoice capture and discrepancy workflow inside Oracle EBS: integration, data flows, setup, pitfalls and AI.
AI on your ERP
- AI for Oracle E-Business Suite, Without Leaving On-PremHosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
- AI for Oracle EBS in Industrial Manufacturing: WIP, MRP, and BOM Questions Answered DirectlyAI for Oracle E-Business Suite in industrial manufacturing: WIP jobs, BOMs, MRP, inventory and purchasing answered in plain English, private and read-only.
Integrations
- How to add WhatsApp to Oracle E-Business SuiteHow to connect WhatsApp Business to Oracle E-Business Suite 12.1 and 12.2: ISG REST, Workflow business events, template messages and two-way replies into EBS.
- How to connect Microsoft Teams to Oracle E-Business SuiteSend Oracle E-Business Suite alerts and approvals to Microsoft Teams with adaptive cards, a bot and Entra ID, using Workflow events and ISG without opening EBS to the internet.