---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# WalkWorkflow - Global

# WalkWorkflow - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The WalkWorkflow script include provides methods to walk a workflow and return a list of successors for each activity along with a shortest path order that indicates the activity depth in the
workflow.

## Walkworkflow - Walkworkflow(GlideRecord workflowVersion) {#ariaid-title2}

Constructor for Walkworkflow class.
{#r_WWF-Walkworkflow_GR__table_mpg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| workflowVersion | GlideRecord | GlideRecord on table wf_workflow_version of the workflow version to analyze. |
[Table 1. Parameters]

{#r_WWF-Walkworkflow_GR__table_mpg_ttp_4t} {#r_WWF-Walkworkflow_GR__table_npg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| Workflow | Workflow object just created. |
[Table 2. Returns]

{#r_WWF-Walkworkflow_GR__table_npg_ttp_4t}

## Walkworkflow - computeFullSequences() {#ariaid-title3}

Computes the full sequence for every path.
Does not combine paths at Join activities. After calling this method, call
getSequences() to yield the computed sequences.
{#r_WWF-computeFullSequences_N__table_wpg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#r_WWF-computeFullSequences_N__table_wpg_ttp_4t} {#r_WWF-computeFullSequences_N__table_xpg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#r_WWF-computeFullSequences_N__table_xpg_ttp_4t}

## Walkworkflow - computeSequences() {#ariaid-title4}

Computes the sequences of activities.
All sequences leading up to a join end at the join and then a single sequence from the join is
computed. This ensures that all sequences can be walked up to a join, and then the sequence
can be walked from the join. After calling this method a call to
getSequences() will yield the computed sequences.
{#r_WWF-computeSequences__table_upg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#r_WWF-computeSequences__table_upg_ttp_4t} {#r_WWF-computeSequences__table_vpg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 6. Returns]

{#r_WWF-computeSequences__table_vpg_ttp_4t}

## Walkworkflow - dump() {#ariaid-title5}

Outputs the internal state of this class to gs.print().
{#r_WWF-dump__table_p3n_wxp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 7. Parameters]

{#r_WWF-dump__table_p3n_wxp_4t} {#r_WWF-dump__table_q3n_wxp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 8. Returns]

{#r_WWF-dump__table_q3n_wxp_4t}

## Walkworkflow - dumpSequences() {#ariaid-title6}

Outputs the sequences internal to this class to
gs.print().
{#r_WWF-dumpSequences__table_r3n_wxp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 9. Parameters]

{#r_WWF-dumpSequences__table_r3n_wxp_4t} {#r_WWF-dumpSequences__table_s3n_wxp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 10. Returns]

{#r_WWF-dumpSequences__table_s3n_wxp_4t}

## Walkworkflow - dumpShortestPathOrders( description) {#ariaid-title7}

Outputs the shortest path orders internal to this object to
gs.print().
{#r_WWF-dumpShortestPathOrders__table_t3n_wxp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 11. Parameters]

{#r_WWF-dumpShortestPathOrders__table_t3n_wxp_4t} {#r_WWF-dumpShortestPathOrders__table_u3n_wxp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 12. Returns]

{#r_WWF-dumpShortestPathOrders__table_u3n_wxp_4t}

## Walkworkflow - getActivitiesAtOrder(Number order) {#ariaid-title8}

Returns all the activities at the specified shortest path order.
{#r_WWF-getActivitiesAtOrder_N__table_qpg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| order | Number | The order number the client is interested in. |
[Table 13. Parameters]

{#r_WWF-getActivitiesAtOrder_N__table_qpg_ttp_4t} {#r_WWF-getActivitiesAtOrder_N__table_rpg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| String Array | An array of activity sys_ids at the specified order. If an empty array is returned, there are no more activities. |
[Table 14. Returns]

{#r_WWF-getActivitiesAtOrder_N__table_rpg_ttp_4t}

## Walkworkflow - getSequences( ) {#ariaid-title9}

Returns the activity sequences.
The walk() method must have been called prior to calling this method.
{#r_WWF-getSequences__table_spg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 15. Parameters]

{#r_WWF-getSequences__table_spg_ttp_4t} {#r_WWF-getSequences__table_tpg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| String | A string of \|-delimited sequences. Each sequence is a comma-delimited list of activity ids (table wf_workflow_activity). |
[Table 16. Returns]

{#r_WWF-getSequences__table_tpg_ttp_4t}

## Walkworkflow - walk(Boolean fullSequences) {#ariaid-title10}

Walks the workflow and sets up the activity shortest path ordering.
After calling this method the client would call the various accessor methods to obtain relevant data about the workflow.
{#r_WWF-walk_B__table_opg_ttp_4t__entry__3}

| Name | Type | Description |
|-|-|-|
| fullSequences | Boolean | (Optional) If true, computes the full sequences. Default is false. |
[Table 17. Parameters]

{#r_WWF-walk_B__table_opg_ttp_4t} {#r_WWF-walk_B__table_ppg_ttp_4t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 18. Returns]

{#r_WWF-walk_B__table_ppg_ttp_4t}

