All Service Now Workflows run on one specific record of a table specified when the Workflow is created.
Note that there is one Special Table called "Global" that can be used when a single Workflow should be used for more than one table.
Each execution of a Workflow is called a "context" and is linked to one specific record, lets say of the sc_req_item table (for Service Request Management).
In General, when looking for anything in Service Now, I recommend a look at the data dictionary.
When checking "Tables" (just enter sys_db_object.list in the Filter Navigator and hit enter), you see that there are a couple of tables with the prefix wf_
(this is a funny thing in Service Now: the naming convention for tables are not consistent at all. I think one of the reasons is that the system does not allow renaming tables. This would be a cool Feature, but it would require proper refactoring support in the codebase).
Anyway, the table you need to look at is called wf_context (again, just enter wf_context.list in the Filter Navigator).
But how do you find the right workflow context?
First, Copy the sys_id of the record in question (from the sc_req_item in our example) into your Clipboard using the Hamburger Menu. Then openwf_context.list and make sure you see the "Related Record" Column (in fact, it is called "id" - it is also impossible to rename a column in Service Now, that might be a reason for this).
Now, use the sys_id in your clipboard as a filter - voilĂ : you see all Workflow contexts of that record.
In the contexts, you can then open the Workflow to see which activity currently is executing and look at the Workflow Log.
In case you wonder how this works, just open the Data Dictionary again (sys_db_object.list in the Filter Navigator) and open the record for wf_context. If you look at the column id, you see that it has the Data Type "Document ID", which can hold any sys_id of the system.
I highly recommend this: Look at how Service Now implemented Features - this way you learn a lot (even some Things that are not officially documented, but very useful).
Note that there is one Special Table called "Global" that can be used when a single Workflow should be used for more than one table.
Each execution of a Workflow is called a "context" and is linked to one specific record, lets say of the sc_req_item table (for Service Request Management).
In General, when looking for anything in Service Now, I recommend a look at the data dictionary.
When checking "Tables" (just enter sys_db_object.list in the Filter Navigator and hit enter), you see that there are a couple of tables with the prefix wf_
(this is a funny thing in Service Now: the naming convention for tables are not consistent at all. I think one of the reasons is that the system does not allow renaming tables. This would be a cool Feature, but it would require proper refactoring support in the codebase).
Anyway, the table you need to look at is called wf_context (again, just enter wf_context.list in the Filter Navigator).
But how do you find the right workflow context?
First, Copy the sys_id of the record in question (from the sc_req_item in our example) into your Clipboard using the Hamburger Menu. Then openwf_context.list and make sure you see the "Related Record" Column (in fact, it is called "id" - it is also impossible to rename a column in Service Now, that might be a reason for this).
Now, use the sys_id in your clipboard as a filter - voilĂ : you see all Workflow contexts of that record.
In the contexts, you can then open the Workflow to see which activity currently is executing and look at the Workflow Log.
In case you wonder how this works, just open the Data Dictionary again (sys_db_object.list in the Filter Navigator) and open the record for wf_context. If you look at the column id, you see that it has the Data Type "Document ID", which can hold any sys_id of the system.
I highly recommend this: Look at how Service Now implemented Features - this way you learn a lot (even some Things that are not officially documented, but very useful).
Comments
Post a Comment