How Flow Designer works.

Uday Kumar Mai1
ServiceNow Employee
ServiceNow Employee

Hello ServiceNow Community

 

We all know how Flow Designer is helping us to fulfil the requirements that our customers have.

 

For What is Flow why we use it Please use the below doc for more information.

Flow Designer(Vancouver) : https://docs.servicenow.com/csh?topicname=flow-designer.html&version=latest

 

Let's understand how the flows are processed in the backend.

 

Normally the flow execution is seen in the form of Flow context(sys_flow_context.LIST) records where we have the flexibility to see where the flow is standing and the progress of the flow.

 

What happens before when the system is going to create the Flow context and execute the transaction? Let's look into that detailed.

 

1. Trigger conditions met.

When the trigger condition of the flow is met we expect the flow to trigger by creating the flow context record.

2. flow. fire Event creation in the backend.

When the trigger conditions are met event is named flow.fire gets created with the Instance field as the flow context sys_id to identify that this event is associated with the flow context. For example, refer to the below image.

 

https://<instance>.service-now.com/sysevent_list.do?sysparm_query=nameSTARTSWITHflow.fire&sysparm_view=

 

3. Flow Engine event handler Jobs.

ServiceNow provides OOB JOBs(sys_trigger.LIST) exclusively to handle the flow.fire events to process the flow engine context records so that the logic written in the flow will get executed.

 

https://<instance>.service-now.com/sys_trigger_list.do?sysparm_query=name%3DFlow%20Engine%20Event%20Handler&sysparm_view=

 

4. Nodes which help JOBS to process the events

There will be nodes allocated to every instance to help jobs handle the events in the ServiceNow system You can view them from the below link.

 

https://<instance>.service-now.com/v_cluster_transaction_list.do?sysparm_query=%5EGROUPBYnode_id

 

So to summarise the details when the Trigger conditions are met flow.fire events in the sysevent.LIST table gets created and Flow engine event handler jobs(sys_trigger.LIST) will be processing those events upon creation and then flow engine contexts get processed upon events processed.

 

Troubleshooting tips When the Flows are not getting processed.

1. Check whether the Flow jobs(sys_trigger.LIST) are in ready state and working

2. To determine whether they are working or not check for the Next action field on jobs(this must be a future time in seconds mostly just now)

3. If the instance is on heavy load with all the jobs occupied with processing any other operations in the instance system might not give enough priority to Flow engine Event Jobs to process the flow.fire events which results in flows stuck in Queued State.

 

Please find the attached Images for flow.fire events and Flow engine event handler jobs

 

Please let me know if you have any questions in the comments let's discuss!

 

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Where is the question I could answer? That post looks more like an article!

Uday Kumar Mai1
ServiceNow Employee
ServiceNow Employee

Maik, This is an article. Can you guide me on where I can post this as an article?  I am new to the community.

Artur Jarzyna
Tera Guru

Hi we are having some performance issues with our flows. I am wondering whether you can help us to find a possible root cause ?

We have a flow with "Wait for Condition" action. We noticed that our flows seems to hang in Waiting state for many hours (up to 24 hours) to proceed even though "Wait for Condition" action conditions are met. I did some investigation and I found that there is a table sys_rw_action [Responders] where ServiceNow create flow.responder records, but in our instance it seems those records are created with a significant delay. In my PDI instance records are created almost immediately.