<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question ATF rollback leaves Flow Designer subflow in Waiting state in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/atf-rollback-leaves-flow-designer-subflow-in-waiting-state/m-p/3576714#M7505</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Issue Description&lt;/STRONG&gt;&lt;BR /&gt;I have a Flow Designer implementation where a main flow calls a subflow to invoke orchestration.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The high-level flow design is as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A form submission triggers the main flow.&lt;/LI&gt;&lt;LI&gt;The main flow calls a subflow, which is responsible for calling the orchestration.&lt;/LI&gt;&lt;LI&gt;Inside this subflow, we use the Call Orchestration action.&lt;/LI&gt;&lt;LI&gt;If the orchestration call fails, or if a failed response is received from orchestration, the Call Orchestration subflow calls a separate failure handling subflow.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow creates an SCTASK for manual action.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow waits until this SCTASK is closed.&lt;/LI&gt;&lt;LI&gt;On the SCTASK, the user selects an action to take on failure, for example Cancel.&lt;/LI&gt;&lt;LI&gt;Once the SCTASK is closed, the failure handling subflow reads the selected action and returns it to the Call orchestration subflow.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow,&amp;nbsp; then returns the action to the main flow.&lt;/LI&gt;&lt;LI&gt;Based on the selected action, the main flow updates the RITM. For example, if the selected action is Cancel, the RITM should be closed as Closed Incomplete.&lt;BR /&gt;In normal execution, this design works as expected.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;ATF Test Scenario&lt;/STRONG&gt;&lt;BR /&gt;I am trying to test this failure task logic using ATF.&lt;/P&gt;&lt;P&gt;The ATF test performs the following steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Submits the form/request to trigger the main flow.&lt;/LI&gt;&lt;LI&gt;Waits for the failure SCTASK to be created.&lt;/LI&gt;&lt;LI&gt;Opens the SCTASK.&lt;/LI&gt;&lt;LI&gt;Sets the failure action field to Cancel.&lt;/LI&gt;&lt;LI&gt;Closes the SCTASK.&lt;/LI&gt;&lt;LI&gt;Validates that the RITM is closed with state Closed Incomplete.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before ATF rollback, everything appears to work correctly:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The SCTASK gets closed.&lt;/LI&gt;&lt;LI&gt;The failure subflow moves to Completed.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow completes.&lt;/LI&gt;&lt;LI&gt;The main flow completes.&lt;/LI&gt;&lt;LI&gt;The RITM is updated correctly to Closed Incomplete.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;BR /&gt;The ATF test runs successfully. The issues happen only after ATF rollback/cleanup completes.&lt;/P&gt;&lt;P&gt;After rollback, I observe the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The main flow context is deleted/cleaned up.&lt;/LI&gt;&lt;LI&gt;The call orchestration subflow context is deleted/cleaned up.&lt;/LI&gt;&lt;LI&gt;The SCTASK appears again in an Open state.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow remains in Waiting state indefinitely.&lt;/LI&gt;&lt;LI&gt;This leaves an orphaned waiting flow context after the ATF test run.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Important Observation&lt;/STRONG&gt;&lt;BR /&gt;This issue happens only in the ATF scenario.&lt;/P&gt;&lt;P&gt;In a normal/manual execution, once the failure subflow is completed, it does not go back to Waiting state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I manually tried the following outside ATF:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Changed the SCTASK state back to Open after the failure subflow completed. Result: The failure subflow did not go back to Waiting state.&lt;/LI&gt;&lt;LI&gt;Deleted the SCTASK after the failure subflow completed. Result: The failure subflow still remained in Completed state.&lt;/LI&gt;&lt;LI&gt;Deleted the parent subflow context, which is the Call orchestration subflow context.&lt;BR /&gt;Result: The failure subflow still remained in Completed state.&lt;BR /&gt;Based on this, I do not think the issue is caused simply by the SCTASK being reopened, deleted, or by the parent subflow context being removed. It seems to happen specifically during ATF rollback/cleanup.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Things I Already Tried&lt;/STRONG&gt;&lt;BR /&gt;I have tried multiple cleanup approaches, but none of them resolved the issue.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Deleted SCTASK and RITM using ATF UI steps and programmatically&lt;BR /&gt;I tried cleaning up the records as the last part of the ATF test.&lt;BR /&gt;I deleted the SCTASK using ATF UI steps.&lt;BR /&gt;I also deleted the RITM using ATF UI steps.&lt;BR /&gt;Additionally, I tried deleting the SCTASK and related records programmatically using a cleanup script.&lt;BR /&gt;However, even after trying both UI-based cleanup and programmatic cleanup, the failure subflow still appeared in Waiting state after ATF rollback.&lt;/LI&gt;&lt;LI&gt;Created a custom event for cleanup&lt;BR /&gt;I created a custom event that is triggered from ATF as the last step.&lt;BR /&gt;The idea was:&amp;nbsp; ATF last step triggers custom event&lt;BR /&gt;Custom event runs cleanup script&lt;BR /&gt;Cleanup script deletes SCTASK and related failure subflow context&lt;BR /&gt;Even with this approach, the failure subflow still remained in Waiting state after ATF rollback.&lt;/LI&gt;&lt;LI&gt;Modified the flow to remove the SCTASK wait condition&lt;BR /&gt;Initially, I thought the issue might be with the failure subflow waiting for: SCTASK state = Closed Complete&lt;BR /&gt;So, I changed the flow and removed the wait condition related to the SCTASK state.&lt;BR /&gt;However, even after deleting/removing that wait step, the failure subflow still went to Waiting state after ATF rollback.&lt;BR /&gt;&lt;BR /&gt;Because of this, I do not think the Wait for SCTASK state = Closed Complete activity is the actual root cause.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Expected Behavior&lt;/STRONG&gt;&lt;BR /&gt;After the ATF test completes and rollback runs, all test-created records and related flow contexts should be cleaned up properly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actual Behavior&lt;/STRONG&gt;&lt;BR /&gt;After ATF rollback:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The SCTASK is open again.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow is in Waiting state indefinitely.&lt;/LI&gt;&lt;LI&gt;The parent/main flow context is already cleaned up.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow context is already cleaned up.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow appears to be orphaned.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Has anyone seen similar behavior where ATF rollback leaves a Flow Designer subflow in Waiting state even though the subflow had already completed successfully before rollback?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I would like to understand:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is this a known limitation when using ATF rollback ?&lt;BR /&gt;Is there a better way to clean up orphaned subflow contexts created during ATF execution?&lt;BR /&gt;Any guidance, known issue reference, or recommended ATF design pattern would be helpful.&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 21 Jul 2026 10:28:21 GMT</pubDate>
    <dc:creator>BhagyashriS4766</dc:creator>
    <dc:date>2026-07-21T10:28:21Z</dc:date>
    <item>
      <title>ATF rollback leaves Flow Designer subflow in Waiting state</title>
      <link>https://www.servicenow.com/community/community-central-forum/atf-rollback-leaves-flow-designer-subflow-in-waiting-state/m-p/3576714#M7505</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Issue Description&lt;/STRONG&gt;&lt;BR /&gt;I have a Flow Designer implementation where a main flow calls a subflow to invoke orchestration.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The high-level flow design is as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A form submission triggers the main flow.&lt;/LI&gt;&lt;LI&gt;The main flow calls a subflow, which is responsible for calling the orchestration.&lt;/LI&gt;&lt;LI&gt;Inside this subflow, we use the Call Orchestration action.&lt;/LI&gt;&lt;LI&gt;If the orchestration call fails, or if a failed response is received from orchestration, the Call Orchestration subflow calls a separate failure handling subflow.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow creates an SCTASK for manual action.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow waits until this SCTASK is closed.&lt;/LI&gt;&lt;LI&gt;On the SCTASK, the user selects an action to take on failure, for example Cancel.&lt;/LI&gt;&lt;LI&gt;Once the SCTASK is closed, the failure handling subflow reads the selected action and returns it to the Call orchestration subflow.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow,&amp;nbsp; then returns the action to the main flow.&lt;/LI&gt;&lt;LI&gt;Based on the selected action, the main flow updates the RITM. For example, if the selected action is Cancel, the RITM should be closed as Closed Incomplete.&lt;BR /&gt;In normal execution, this design works as expected.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;ATF Test Scenario&lt;/STRONG&gt;&lt;BR /&gt;I am trying to test this failure task logic using ATF.&lt;/P&gt;&lt;P&gt;The ATF test performs the following steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Submits the form/request to trigger the main flow.&lt;/LI&gt;&lt;LI&gt;Waits for the failure SCTASK to be created.&lt;/LI&gt;&lt;LI&gt;Opens the SCTASK.&lt;/LI&gt;&lt;LI&gt;Sets the failure action field to Cancel.&lt;/LI&gt;&lt;LI&gt;Closes the SCTASK.&lt;/LI&gt;&lt;LI&gt;Validates that the RITM is closed with state Closed Incomplete.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before ATF rollback, everything appears to work correctly:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The SCTASK gets closed.&lt;/LI&gt;&lt;LI&gt;The failure subflow moves to Completed.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow completes.&lt;/LI&gt;&lt;LI&gt;The main flow completes.&lt;/LI&gt;&lt;LI&gt;The RITM is updated correctly to Closed Incomplete.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;BR /&gt;The ATF test runs successfully. The issues happen only after ATF rollback/cleanup completes.&lt;/P&gt;&lt;P&gt;After rollback, I observe the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The main flow context is deleted/cleaned up.&lt;/LI&gt;&lt;LI&gt;The call orchestration subflow context is deleted/cleaned up.&lt;/LI&gt;&lt;LI&gt;The SCTASK appears again in an Open state.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow remains in Waiting state indefinitely.&lt;/LI&gt;&lt;LI&gt;This leaves an orphaned waiting flow context after the ATF test run.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Important Observation&lt;/STRONG&gt;&lt;BR /&gt;This issue happens only in the ATF scenario.&lt;/P&gt;&lt;P&gt;In a normal/manual execution, once the failure subflow is completed, it does not go back to Waiting state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I manually tried the following outside ATF:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Changed the SCTASK state back to Open after the failure subflow completed. Result: The failure subflow did not go back to Waiting state.&lt;/LI&gt;&lt;LI&gt;Deleted the SCTASK after the failure subflow completed. Result: The failure subflow still remained in Completed state.&lt;/LI&gt;&lt;LI&gt;Deleted the parent subflow context, which is the Call orchestration subflow context.&lt;BR /&gt;Result: The failure subflow still remained in Completed state.&lt;BR /&gt;Based on this, I do not think the issue is caused simply by the SCTASK being reopened, deleted, or by the parent subflow context being removed. It seems to happen specifically during ATF rollback/cleanup.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Things I Already Tried&lt;/STRONG&gt;&lt;BR /&gt;I have tried multiple cleanup approaches, but none of them resolved the issue.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Deleted SCTASK and RITM using ATF UI steps and programmatically&lt;BR /&gt;I tried cleaning up the records as the last part of the ATF test.&lt;BR /&gt;I deleted the SCTASK using ATF UI steps.&lt;BR /&gt;I also deleted the RITM using ATF UI steps.&lt;BR /&gt;Additionally, I tried deleting the SCTASK and related records programmatically using a cleanup script.&lt;BR /&gt;However, even after trying both UI-based cleanup and programmatic cleanup, the failure subflow still appeared in Waiting state after ATF rollback.&lt;/LI&gt;&lt;LI&gt;Created a custom event for cleanup&lt;BR /&gt;I created a custom event that is triggered from ATF as the last step.&lt;BR /&gt;The idea was:&amp;nbsp; ATF last step triggers custom event&lt;BR /&gt;Custom event runs cleanup script&lt;BR /&gt;Cleanup script deletes SCTASK and related failure subflow context&lt;BR /&gt;Even with this approach, the failure subflow still remained in Waiting state after ATF rollback.&lt;/LI&gt;&lt;LI&gt;Modified the flow to remove the SCTASK wait condition&lt;BR /&gt;Initially, I thought the issue might be with the failure subflow waiting for: SCTASK state = Closed Complete&lt;BR /&gt;So, I changed the flow and removed the wait condition related to the SCTASK state.&lt;BR /&gt;However, even after deleting/removing that wait step, the failure subflow still went to Waiting state after ATF rollback.&lt;BR /&gt;&lt;BR /&gt;Because of this, I do not think the Wait for SCTASK state = Closed Complete activity is the actual root cause.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Expected Behavior&lt;/STRONG&gt;&lt;BR /&gt;After the ATF test completes and rollback runs, all test-created records and related flow contexts should be cleaned up properly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actual Behavior&lt;/STRONG&gt;&lt;BR /&gt;After ATF rollback:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The SCTASK is open again.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow is in Waiting state indefinitely.&lt;/LI&gt;&lt;LI&gt;The parent/main flow context is already cleaned up.&lt;/LI&gt;&lt;LI&gt;The Call orchestration subflow context is already cleaned up.&lt;/LI&gt;&lt;LI&gt;The failure handling subflow appears to be orphaned.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Has anyone seen similar behavior where ATF rollback leaves a Flow Designer subflow in Waiting state even though the subflow had already completed successfully before rollback?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I would like to understand:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is this a known limitation when using ATF rollback ?&lt;BR /&gt;Is there a better way to clean up orphaned subflow contexts created during ATF execution?&lt;BR /&gt;Any guidance, known issue reference, or recommended ATF design pattern would be helpful.&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Jul 2026 10:28:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/atf-rollback-leaves-flow-designer-subflow-in-waiting-state/m-p/3576714#M7505</guid>
      <dc:creator>BhagyashriS4766</dc:creator>
      <dc:date>2026-07-21T10:28:21Z</dc:date>
    </item>
  </channel>
</rss>

