How to get the context of the flow/ subflow that is running/executing within the flow designer

Shariq Azim
Kilo Guru

Hello,

I am trying to get the  context id of the executing flow designer within the sub flow of flow designer?

The API provided in https://developer.servicenow.com/dev.do#!/reference/api/orlando/server/sn_fd-namespace/ScriptableFlowAPI only speaks about getting the contextId if the  flow is executed through script...more aptly getting the context id after the   execution of the SUBFLOW is triggered .

For example , adding "worknotes link action" adds the flow to the  worknotes similarly i was trying to query on the context id after creation .

 

The whole idea is to have an active  check for the flow execution and raising a task if any error arises on using oob AD spokes.

Because for some reasons often randomly the flow is failing due to powershell  script failing to execute.

 

Regards,

Shariq

1 ACCEPTED SOLUTION

@Shariq 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

If not, please let us know if you need some more assistance.

Thanks!
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can query sys_flow_context table and check any record present with the current record sys_id

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Shariq 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

If not, please let us know if you need some more assistance.

Thanks!
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello Ankur,

Can you elaborate more on the process above?

 

You need to visit that table and look for your flow context associated to the record you are looking for

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader