HRSD Lifecycle Events - task created from a subflow is not attached to Activity Set on portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 11:21 AM
Hello fellow developers,
I've ran into an issue while trying to construct a Lifecycle Event in ServiceNow HRSD.
Because of the complexity of the expectations, I have to create some tasks from a subflow, which I trigger from an Activity. The tasks are created all right but ServiceNow does not handle them like tasks created by an Activity directly - when a user opens their Journey from the Employee Portal, the tasks created by the flow show up under "Other tasks", they are not under the proper Activity Set. And this is confusing as the progress of the Journey is not clear, "Other Tasks" always show up at the bottom of the list even after they are completed.
The problem is that I'm unable to properly attach the flow-created tasks to the Activity Set they belong to. They are set to belong to the right Lifecycle Event Case (through the tasks' "parent" field) and there is also an "Activity" field on the task record, which I set to the activity that triggered the creation of the task (this is a reference field to the Activity base [sn_hr_le_activity] table). However, nothing happens, the task is still under "Other tasks".
Did I miss to set an important field during task creation? I read that unless the task is created by the so-called Activity Engine, the system cannot handle it properly and that's why it is added to the "Other tasks" category. But I haven't been able to find a solution to creating a task from a subflow in the way the Activity Engine does. (There should be a way if an Activity is allowed to trigger a flow and I guess it's not uncommon to create tasks from it...)
Please share if you have any ideas on how to solve this or push me on the right track if I missed something. (I experienced this on Xanadu, now I'm upgrading to Yokohama to see if that solves the issue).
Thank you!
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:21 AM
i will suggest you a quick solution, but i will recommend you to open a different thread because your issue is a different one.
In your Lifecycle activity you can chose the type and have a mapping.
You are able to give your subflow a object which matches your flow input. In your mapping you can set via your parent case.
your parameter on the "sn_hr_le_activity_field_mapping" table should be:
map from = "custom script" to open the script field and map to flow input = "your reference inputvalue of your subflow"
going from that you should be able to find a resolution of your requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 04:01 AM
Thanks, the object mapping worked, thank you.
I thought it would be quick to ask here, Apologies for using this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 11:25 PM
Hi,
I'm just adding a quick note here, basically the same information but from a different angle so that it is easier for others to understand.
So passing parameters from the Activity to the subflow is very simple: if you create the subflow and define the input parameters there, as soon as you set the Activity type to Flow and select your subflow, the input parameters of the subflow will automatically appear in the mapping section, all you have to do is select the table and the field to be mapped. As far as I know, only HR Case tables can be chosen here by the way.
Hope it helps someone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:24 AM
I am kinda late to the party, but your subflow doesnt set the activity field of your task automatically.
i used to set an update record which sets the parent and the field sn_hr_le_activity should be set with the sysID of your activity.