Is it possible to view Flow Designer execution from the contextual record?

lmorlupi
ServiceNow Employee
ServiceNow Employee

Hello,

is it possible to view Flow Designer execution (Kingston release) from the contextual record?

I would like to replicate the "Show Worfklow" capability provided with the previous orchestration workflows.

Thanks, Luca

1 ACCEPTED SOLUTION

Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

I did some reverse Engineering and it seems, there is no reference (documentkey) to the record.

Instead the link can be found in a JSON object in field inputs of table sys_flow_action_report.
I created a Script Include that returns the flow context sys_id based on either a GlideRecord,
or the combination of tablename and sys_id.

This I use in a UI Page containing links to the context records.
On it's turn the UI page is opened from a UI action.

You can download the updateset from Share

 

Video:

 

View solution in original post

14 REPLIES 14

on my personal instance everything is working fine, but on the instance of my company, the sys_flow_plan_context_binding table doesnt get any new records, does anyone has any ideas why not? thank you in advance, simon

Tom Cullen
ServiceNow Employee
ServiceNow Employee

Flow designer is great and with the release of Madrid continues to add  new features and actions.  The only thing I miss is the ability to check what is going on with the corresponding Flow.  I want the same functionality as Show Workflow.  I believe there will be an OOB UI Action, but until then this should provide the same functionality.

ShowFlow UI Action

Vinay88
Kilo Contributor

go to flow designer->Active flows. There you have your contexts. Then if you click on a record, you have a UI Action that is pretty much the same as "show workflow"

alexgg57
Tera Expert

It does show active flow, but if (like me) need to see active components of the flow (e.g. action) it's not possible...

Is there a way to see the status (run, wait, complete, etc.) of some action which calls by Flow?

skh
Kilo Contributor

Thought I could provide a 'quick and easy' solution to this one, since I just got a good fix.  This isnt *exactly* what you're asking for, tho i happen to think its better, since there's a lot of valuable diagnostic information provided by 'flow action contexts'. This is a UI Action to execute a search for all execution contexts related to the user's current record.

To see the visualization of the flow, simply navigate to your context from the search and click the 'Open in Operation View' link. 

I'll provide all the context I can, too.

- Go to this table: https://{INSERT YOUR OWN DEVELOPMENT INSTACNCE URL}/nav_to.do?uri=%2Fsys_ui_action_list.do

- Click 'New'

- Enter a Name

- Select the table your records are stored on (like 'Incidents')

- Check all the Boxes Shown

find_real_file.png

 

- Insert the following into the Condition field:

-------------------------

!current.isNewRecord() && (new Workflow().hasWorkflow(current))

-------------------------

- Insert the following into the 'Onclick' field:

------------------------

searchFlowExecutions()

------------------------

- Insert this Script into the 'Script' field:

------------------------

// Show the workflow context in a new window
function searchFlowExecutions() {
var id = g_form.getUniqueValue().toString();
// var url = new GlideURL('wf_context_list.do');
var url = new GlideURL('sys_flow_context_list.do');
var full_query = 'source_record=' + id;
url.addParam('sysparm_query', full_query);
g_navigation.open(url.getURL());
}

---------------------

- Click 'Form Action', and 'Isolate Script'

 - Click 'Save' (obviously).

I hope this helps.  If you *really* want to replicate the old behavior of jumping straight to the chart without the context, you could probably do something clever with multiple glide record calls.  But frankly, I think that's kind of messy, and gives you *less* diagnostic information than just popping up the results of a search for all the related contexts.