The WorkflowPath object provides access to the attributes of a path contained within a job Workflow.
The WorkflowPath object supports describing a path and navigating through the workflow.
The description of the path, also known as the path name.
The ID of the WorkflowStep object the path originates from.
The ID of the destination WorkflowStep object the path is headed towards.
The following script obtains a workflow path's description and the step IDs of the steps that go into and out of the path.
#Establish a connection to a Workflow database
conn = arcpy.wmx.Connect(r'c:\test\Workflow.jtc')
#Access a Job
job = conn.getJob(99999)
#Access a the job's workflow
workflow = job.getWorkflow()
#Access the first step in the workflow
step = workflow.steps
#Access the paths following the first step in the workflow
paths = step.nextSteps
#Access the first path and print the ID of the step it leads to
path = paths
print('The ID of the step that follows the first step is ' + path.toStep)