Happy Business Starts Here

Searching through Workflows through a specific field processed in it

0 Kudos

Searching through Workflows through a specific field processed in it

Hi All,

I recently had a requirement where I needed to browse through tonnes of WFs and figure out a specific one. For the use case say a WF runs for an account on a subscription(may create/update/delete). This WF runs multiple times every day. Now to find a particular instance of the WF run where it processed a particular subscription is too hard to find (as there are so many).

The idea is that in the tasks tab, you enter the ID processed via tha WF and you would know from history whether or not WF was run for that particular ID

1 Comment
msonsma
Valued Scholar

Hi @sayam 

 

Another - much easier - option is to tag the Zuora object processed by a workflow with the id of that workflow instance. 

 

Just define a custom field ( type text, UI read-only ) on the object class processed by the workflow and set the field value - in the workflow - to the output of the following Liquid expression:

 

{{WorkflowInstance.name}}-{{ "now" | date: "%Y%m%d%H%M%S" }}

 

This will generate a string like 

 

WF-2574-00000074-20210408132928

 

Which identifies the workflow id  ( = 2574 ) and the execution instance ( = 74 ) 

 

You can than open that workflow by the following URL 

 

https://apisandbox.zuora.com/services/workflow/workflows/<workflowid>

 

unfortunately you can NOT directly open the exact execution instance with as some 'brain damaged' engineer decided not to use the execution id number in the the URL to open a execution instance but some other (tenant) counter id.

 

In the example given the URL for open the specific execution instance is: 

 

https://apisandbox.zuora.com/services/workflow/workflows/2574/executions/2745

 

and not the more logical and expected URL:

 

https://apisandbox.zuora.com/services/workflow/workflows/2574/executions/74

 

@Zuora: Why ????

 

You can this custom field also to check whether an items has already been processed or not by the workflow. 

 

Another option would to track the objects processed by a workflow in a (shared) custom object table. See it as as some kind of audit table for workflows. ( Custom objects require an additional license ) 

 

BR

Manfred

SubscriptionFactory.com