Lifecycle event: attach a (sub?)flow and trigger it from the activity sets with parameters

Ward van Hoof
Mega Guru

Dear all,

On my personal dev I'm trying to automate part of the lifecycle activities by creating a flow which is triggered at a specific point in the activity set. However, I am not sure how to configure it. I checked the documentation (https://docs.servicenow.com/bundle/orlando-hr-service-delivery/page/product/human-resources/task/configure-hr-lifecycle-event-activity.html#configure-lifecycle-event-activity-flow) which is not very specific so i was hoping you could help me.

I can configure a lifecycle activity of type "flow". Do i attach a "flow" or a "subflow" to this activity? Both are available from the list.

If i attach a subflow without parameters, i get the error shown in screenshot 1 (incorrect parameter configuration).

I will, however, need to pass parameters of the case to the subflow. When i tried to configure parameters, the same error occured. WHen i attach a subflow with input parameters, i do not see how i can specify how parameters should be filled.
Is it possible that in the context of the subflow i have access to the current case record? How can i configure Input paramters on the subflow and fill them using the "lifecycyle activity"? 

If i have to use a regular flow, i would like to know how to trigger it. The flow needs a trigger of type "created" or "updated", if it is not a "service catalog" flow. However, i want to trigger the flow from a specific point in the life cycle events (triggered in a specific activity set). I do not think that a Flow on the HR Case table will trigger at the right moment if i select "update" with some conditions.

Could you guide me through the correct way to trigger a flow or subflow from a lifecycle activity?

Thanks in advance for your assistance.
All the best,

Ward van Hoof

 

1 ACCEPTED SOLUTION

Ward van Hoof
Mega Guru

I logged a HI ticket and this problem article was linked. Using the information below helped me to trigger the flow (though there's no relation from the flow to the case / activity which triggered it)

PRB1381783

In addition to the above issue, the The following additional limitations / issues have been identified:
1) Results in a runtime error if the configured Flow does not have "user" and "job" inputs defined (LE Activity configuration currently allows you to select any active, published flow including ones without these parameters).
2) Results in a runtime error if the configured Flow is not a Subflow (LE Activity configuration allows selection of both flows and subflows)
3) Default Inputs to the subflow for the parent case and lifecycle activity are missing, which would be relevant contextual information for many general use cases
4) There is no tracking mechanism in place to keep the Lifecycle Activity active while the subflow is still running

View solution in original post

12 REPLIES 12

rhysbrennan
Tera Expert

I don't know if its the correct way but there are two tables to look at, there is a questions and answers table that stores record producer inputs and you can trigger the flow from the Lifecycle Events table. I did this in my PD instance but it's not very dynamic like the service catalogue support in ITSM. 

I have been trying to get an answer out of our accounts team on this as well. It seems to be supported as per Docs https://docs.servicenow.com/bundle/newyork-hr-service-delivery/page/product/human-resources/task/con... but how it's intended to be used officially is unknown, seems to be for reference only, it doesn't actually trigger the Flow.

Ward van Hoof
Mega Guru

I logged a HI ticket and this problem article was linked. Using the information below helped me to trigger the flow (though there's no relation from the flow to the case / activity which triggered it)

PRB1381783

In addition to the above issue, the The following additional limitations / issues have been identified:
1) Results in a runtime error if the configured Flow does not have "user" and "job" inputs defined (LE Activity configuration currently allows you to select any active, published flow including ones without these parameters).
2) Results in a runtime error if the configured Flow is not a Subflow (LE Activity configuration allows selection of both flows and subflows)
3) Default Inputs to the subflow for the parent case and lifecycle activity are missing, which would be relevant contextual information for many general use cases
4) There is no tracking mechanism in place to keep the Lifecycle Activity active while the subflow is still running

nonamenic
Tera Contributor

Hello, I am also running into this issue. I have no clue how to trigger the flow/subflow (whichever it is), or what data is passed to the flow. Can you walk me through this if you were able to figure it out? Thank you

Hi, it still doesn't work completely for me, but this is how i trigger it now:

1. create a subflow with 2 input parameters "job" and "user" (no more, no less) (note, user is filled with sys id of the subject person)

2. create a lifecycle activity which calls this subflow 

3. Do in your sublfow what ever you want to do (me, i retrieve the case by querying for subject person and HR service (order by date descending))

4. Be stuck: I don't know how to send back to the "lifecycle event workflow" that my flow has been completed. (if i move the case to completed, the lifecylce event workflow is cancelled, if i don't update the case it remains waiting...)