Skip to main content

Check out Port for yourself ➜ 

Interact with workflow runs

When a workflow is executed, it creates a workflow run that tracks the execution progress. Each node in the workflow creates a node run that captures its status, logs, and output.

Viewing workflow runs

From the Workflows page

  1. Navigate to the Workflows page
  2. Click on a workflow to view its details
  3. The Runs tab shows all executions of that workflow

From entity pages

Workflow runs associated with an entity appear in the entity's activity feed and can be accessed from the entity page.

Run structure

A workflow run contains:

FieldDescription
identifierUnique run identifier (format: wfr_xxxx)
statusCurrent status: IN_PROGRESS or COMPLETED
resultFinal result: SUCCESS, FAILED, or CANCELLED
nodeRunsArray of node run objects
variablesRuntime variables including outputs
createdAtWhen the run started
completedAtWhen the run finished
createdByUser or system that triggered the run

Node run structure

Each node run contains:

FieldDescription
identifierUnique node run identifier (format: wfnr_xxxx)
nodeTitleTitle of the node
nodeIconIcon of the node
nodeConfigTypeType of node (e.g., WEBHOOK, UPSERT_ENTITY)
statusCurrent status: IN_PROGRESS or COMPLETED
resultFinal result: SUCCESS, FAILED, or CANCELLED
outputOutput data from the node
nodeRunLogsArray of log entries
createdAtWhen the node started
completedAtWhen the node finished

Updating node runs

External systems can update node run status and add logs using Port's API. This is useful when:

  • Using asynchronous webhooks
  • Processing Kafka messages
  • Running long-running operations

Update node run status

curl -X PATCH "https://api.getport.io/v1/workflows/runs/{workflow_run_id}/nodes/{node_run_id}" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"status": "COMPLETED",
"result": "SUCCESS",
"output": {
"resourceId": "abc123",
"deploymentUrl": "https://my-app.example.com"
}
}'

Request body

FieldTypeDescription
statusstringIN_PROGRESS or COMPLETED
resultstringRequired if status is COMPLETED: SUCCESS, FAILED, or CANCELLED
outputobjectOutput data to make available to subsequent nodes
logsarrayLog entries to add to the node run

Adding logs

Include log entries when updating a node run:

{
"status": "IN_PROGRESS",
"logs": [
{
"logLevel": "INFO",
"log": "Starting deployment to production",
"tags": {
"environment": "production",
"version": "1.2.3"
}
},
{
"logLevel": "INFO",
"log": "Deployment completed successfully"
}
]
}

Log levels: DEBUG, INFO, WARN, ERROR

Run outputs

Node outputs are stored in the workflow run's variables.outputs and can be referenced by subsequent nodes:

{
"variables": {
"outputs": {
"create_resource": {
"resourceId": "abc123",
"resourceUrl": "https://..."
},
"notify": {
"messageId": "msg_456"
}
}
}
}

Reference in subsequent nodes:

{
"body": {
"resourceId": "{{ .outputs.create_resource.resourceId }}"
}
}

Run permissions

By default, anyone in the organization can view workflow runs. You can restrict this using the allowAnyoneToViewRuns workflow setting:

{
"identifier": "my-workflow",
"allowAnyoneToViewRuns": false,
...
}

When set to false, only users with appropriate permissions can view the run details.

Example

External processing

Here's an example of how an external system might process a webhook action:

Python example (click to expand)
import requests

def process_webhook(webhook_data):
"""Process a webhook and report back to Port"""

workflow_run_id = webhook_data['context']['workflowRunId']
node_run_id = webhook_data['context']['nodeRunId']

# Log the start
update_node_run(workflow_run_id, node_run_id, {
"status": "IN_PROGRESS",
"logs": [{
"logLevel": "INFO",
"log": "Processing started"
}]
})

try:
# Do the actual work
result = perform_operation(webhook_data['payload'])

# Report success
update_node_run(workflow_run_id, node_run_id, {
"status": "COMPLETED",
"result": "SUCCESS",
"output": result,
"logs": [{
"logLevel": "INFO",
"log": f"Operation completed: {result}"
}]
})
except Exception as e:
# Report failure
update_node_run(workflow_run_id, node_run_id, {
"status": "COMPLETED",
"result": "FAILED",
"logs": [{
"logLevel": "ERROR",
"log": f"Operation failed: {str(e)}"
}]
})

def update_node_run(workflow_run_id, node_run_id, data):
"""Update a node run via Port API"""
response = requests.patch(
f"https://api.getport.io/v1/workflows/runs/{workflow_run_id}/nodes/{node_run_id}",
headers={
"Authorization": f"Bearer {get_port_token()}",
"Content-Type": "application/json"
},
json=data
)
response.raise_for_status()

Limitations

The following run features are not yet available in workflows (Beta):

  • Re-run workflow: Ability to re-run a workflow from the UI.
  • Partial re-run: Re-run from a specific node.
  • Cancel in-progress run: Cancel a running workflow.