Showing posts with label WORKFLOW. Show all posts
Showing posts with label WORKFLOW. Show all posts

Sunday, February 15, 2026

Workflow Services Not Starting in Oracle E-Business Suite R12 – BES Control Queue Fix

Workflow Services Not Running or Starting in Oracle E-Business Suite R12 (Target=1, Actual=0) – Complete Fix

In Oracle E-Business Suite R12, Oracle Workflow Services may sometimes fail to start from the frontend (System Administrator responsibility) or from the Concurrent > Manager > Administer form. In this scenario, Workflow service components remain stuck with:

  • Target = 1
  • Actual = 0

This post provides a clean, production-friendly fix to bring the Workflow services back online, along with the MOS-based advanced recovery for the common Service Component Container error.


Affected Workflow Components (Service Managers)

  • Workflow Agent Listener ServiceWFALSNRSVC
  • Workflow Mailer ServiceWFMLRSVC
  • Workflow Document Web Services ServiceWFWSSVC

How to Confirm the Service Short Names (SQL)

You can confirm the concurrent queue short names using the following queries:

Workflow Agent Listener Service

SELECT concurrent_queue_name
FROM apps.fnd_concurrent_queues_tl
WHERE user_concurrent_queue_name = 'Workflow Agent Listener Service';

Workflow Mailer Service

SELECT concurrent_queue_name
FROM apps.fnd_concurrent_queues_tl
WHERE user_concurrent_queue_name = 'Workflow Mailer Service';

Workflow Document Web Services Service

SELECT concurrent_queue_name
FROM apps.fnd_concurrent_queues_tl
WHERE user_concurrent_queue_name = 'Workflow Document Web Services Service';

Solution (Primary Fix) – Reset Workflow Service Manager Definitions

⚠️ Important: Run the below updates carefully (preferably during a controlled window). Take a backup / snapshot before changes in Production. Execute as APPS.

Step 1 – Set process values to zero

UPDATE fnd_concurrent_queues
   SET running_processes = 0,
       max_processes     = 0
 WHERE concurrent_queue_name IN ('WFWSSVC','WFALSNRSVC','WFMLRSVC');

Step 2 – Reset invalid control codes (if applicable)

UPDATE fnd_concurrent_queues
   SET control_code = NULL
 WHERE concurrent_queue_name IN ('WFWSSVC','WFALSNRSVC','WFMLRSVC')
   AND control_code NOT IN ('E','R','X')
   AND control_code IS NOT NULL;

Step 3 – Clear target node (remove node binding)

UPDATE fnd_concurrent_queues
   SET target_node = NULL
 WHERE concurrent_queue_name IN ('WFWSSVC','WFALSNRSVC','WFMLRSVC');

Step 4 – Commit

COMMIT;

What Happens Next?

After the above reset, wait a few minutes. The Internal Concurrent Manager (ICM) typically brings the services up automatically.

Verification – Confirm Workflow Service Managers Are Up

SELECT concurrent_queue_name,
       control_code,
       running_processes,
       max_processes
  FROM fnd_concurrent_queues
 WHERE concurrent_queue_name IN ('WFALSNRSVC','WFMLRSVC','WFWSSVC');

Expected state:

  • CONTROL_CODE should typically be C
  • RUNNING_PROCESSES should be 1
  • MAX_PROCESSES should be 1 (or as configured)

Common Error Seen (When Services Still Do Not Start)

In some cases, the services still fail with the following error:

ERROR:[SVC-GSM-WFALSNRSVC-9700 : oracle.apps.fnd.cp.gsc.SvcComponentContainer.startBusinessEventListener()]:
BES system could not establish connection to the control queue after 180 seconds

oracle.apps.fnd.cp.gsc.SvcComponentContainerException:
Could not start Service Component Container

This points to an issue with the Business Event System (BES) control queue / container configuration.


Advanced Fix (MOS) – Rebuild Workflow Control Queue / Container

🚨 MOS-Based Fix: Use this only when the primary fix does not resolve the issue and the error shows SvcComponentContainerException.

Refer to Oracle Support Document:

Starting Workflow Services Fails With Error oracle.apps.fnd.cp.gsc.SvcComponentContainerException Could not start Service Component Container
Doc ID 1663093.1

As per the document, run the following script to rebuild the Workflow control queue/container configuration:

Run as APPS user:

sqlplus apps/xxxxxxx @$FND_TOP/patch/115/sql/wfctqrec.sql APPLSYS xxxx

Replace:

  • xxxxxxx → APPS password
  • xxxx → APPLSYS password

Important Notes

  • Ensure Workflow Services are stopped before running the script.
  • Take a database backup / snapshot before executing in Production.
  • After script execution, bounce Concurrent Managers (or at least ICM).
  • Wait a few minutes and recheck the service status.

Post-Fix Verification

SELECT concurrent_queue_name,
       control_code,
       running_processes,
       max_processes
  FROM fnd_concurrent_queues
 WHERE concurrent_queue_name IN ('WFALSNRSVC','WFMLRSVC','WFWSSVC');

Once the Workflow services are healthy, you should see the managers running and the frontend should reflect:

  • Target = 1
  • Actual = 1

Root Cause (Why This Happens)

  • Corrupt / stale Service Component Container configuration
  • Invalid node binding (TARGET_NODE) after cloning or node changes
  • Improper shutdown causing inconsistent queue state
  • BES control queue connection timeouts

Conclusion

Workflow services stuck at Target=1 / Actual=0 can be fixed safely by resetting the service manager definitions in FND_CONCURRENT_QUEUES. If the environment throws the Service Component Container exception, the MOS script (wfctqrec.sql) provides the advanced recovery to rebuild the container/control queue configuration.

— Punit Kumar
Oracle EBS Techno Functional Consultant


Tags

Oracle EBS, R12, Workflow Mailer, WFALSNRSVC, WFMLRSVC, WFWSSVC, Concurrent Manager, ICM, BES, Service Component Container, wfctqrec.sql, Doc ID 1663093.1

Saturday, December 21, 2024

Workflow debugging scripts wfstat.sql

 Understanding the Workflow debugging scripts wfstat.sql


The wfstat.sql script is a valuable tool used in Oracle E-Business Suite (EBS) for debugging and understanding the status and flow of workflows. It helps track, analyze, and debug workflow-related issues by providing detailed insights into the workflow statuses, activities, notifications, and related details.

Here’s how to understand and use the wfstat.sql script for debugging workflows:


Purpose of wfstat.sql

  • To fetch the status of a specific workflow instance.
  • To provide detailed information on the workflow's current state, activities, notifications, and their statuses.
  • To debug issues in workflow execution, such as stuck or errored activities.

Key Parameters of wfstat.sql

  1. ITEM_TYPE: The type of workflow item (e.g., REQAPPR for requisition approval, POAPPRV for purchase order approval).
  2. ITEM_KEY: The unique identifier for a specific workflow instance.
  3. USER_ID (optional): Used to filter workflow details specific to a user.
  4. ACTIVITY_STATUS: Filters activities based on their status (e.g., OPEN, COMPLETED, ERROR).

Steps to Use wfstat.sql

  1. Locate the script: The wfstat.sql script is typically located in $FND_TOP/sql/ or your database administrator may provide access to the script.
  2. Run the script: Execute the script using SQL*Plus or a similar SQL client.
    SQL> @wfstat.sql
  3. Provide Input: Enter the required parameters such as ITEM_TYPE and ITEM_KEY when prompted.
  4. Analyze the Output:
    • Workflow Instance Information: Details about the workflow, including creation date, status, and current owner.
    • Activity Statuses: Shows activities in the workflow, their status (OPEN, COMPLETED, ERROR), and timestamps.
    • Notifications: Information on notifications sent as part of the workflow, including status (SENT, CANCELED, ERROR).
    • Error Details: If an activity is in error, the output will indicate the error message or stack trace.

Debugging Common Issues

  1. Stuck Activities:
    • Check for OPEN activities that have not progressed.
    • Identify the ACTIVITY_NAME and trace the issue in the corresponding PL/SQL procedure or function.
  2. Errored Activities:
    • Look for activities with the status ERROR.
    • Review the error messages or stack trace in the output.
  3. Notification Issues:
    • Check the notification statuses (SENT, CANCELED, ERROR).
    • If notifications are not being sent, verify the workflow mailer service and notification preferences.
  4. Workflow Ownership:
    • Ensure that the workflow item has the correct owner (RUNNING or DEFERRED).
    • Reassign ownership if necessary using administrative workflow tools.

Proactive Measures

  • Schedule regular audits of critical workflows using scripts like wfstat.sql.
  • Monitor notifications and activity logs for potential issues.
  • Automate repetitive tasks in workflow monitoring using shell scripts or custom reports.

By using the wfstat.sql script effectively, you can identify, troubleshoot, and resolve workflow-related issues, ensuring seamless operation of Oracle E-Business Suite workflows.


While logging a bug in Workflow area, it is always advisable to provide output of some of the diagnostic scripts such as wfstat.sql. This blog provides a detailed description about the usage of and the information this script provide. Output of wfstat.sql script provides workflow activity details for a given workflow process. Output of wfmlrdbg.sql provides details about a particular notification that are used to debug any issues with a Workflow Notification. wfbesdbg.sql is used to debug the event and subscription related issues in Business Event System.

wfstat.sql

This script can be used to debug the workflow activity issues for a given workflow. It can be run using the below command. Use spool command to generate the output of this into a text file.


SQL>spool wfstat.txt
SQL>sqlplus apps/apps @$FND_TOP/sql/wfstat.sql <item type> <item key>
SQL>spool off;


It generates a text file called wfstat.txt that contains output of this script. You can get the following information from this:

  1. Workflow item type and itemkey
  2. Workflow activities' start time and end time
  3. Parent process and child process information
  4. Status and result of each activity
  5. Start date and End date of each activity
  6. Errored Activities and Error Process Activity Statuses
  7. Notification details with notification id and notification recipient
  8. Performer of each activity.

The following section explains each item from the output file:

WorkFlow Item

It provides item type, item key, start date and end date for the workflow item. It also provides the root activity details for the same.

Activity Statuses

It provides start date, end date, status, result for each of the activities. In addition to that it provides the performer user and notification ID for Notification activities. It also provides the sequence of execution of the activities.

Activity Statuses History

It provides status history of the all the actions performed on the different activities

Notifications

It provides information about a notification such as Notification ID, status, message name, begin date, end date, from-user, to-user, subject.

Errored Activities

It provides all the activities information that are resulted into ERROR status.