Share a pre-filled workflow URL
Port allows you to generate links that pre-fill workflow inputs, making it easy to share workflow execution URLs with your developers.
This is particularly useful when you want to:
- Create bookmarks for commonly used workflows with specific inputs.
- Share workflow execution links in documentation or runbooks.
- Programmatically generate workflow links from your systems.
How it works
The workflow execution URL follows this structure:
https://app.port.io/self-serve?workflow=WORKFLOW_IDENTIFIER/TRIGGER_IDENTIFIER&workflowInputs=ENCODED_INPUTS
WORKFLOW_IDENTIFIERis your workflow's unique identifier.TRIGGER_IDENTIFIERis the identifier of the self-service trigger node inside that workflow. Because a workflow can have multiple self-service trigger nodes, the two identifiers together form a compound ID that uniquely points to a specific trigger.ENCODED_INPUTSis a minified version of your inputs using JSURL encoding. This parameter is optional — omitting it opens the execution form without any pre-filled values.
Opening the URL scrolls the Self-Service Hub to the matching workflow card and automatically opens its execution form. If workflowInputs is provided, the form fields are pre-filled with the decoded values.
Generate a workflow execution URL
To generate a workflow execution URL with pre-filled inputs, use the jsurl2 library to encode the inputs.
Code example (click to expand)
// Load jsurl2 library
let script = document.createElement("script");
script.src = "https://cdn.jsdelivr.net/npm/jsurl2";
document.head.appendChild(script);
script.onload = function () {
// Your workflow inputs
let workflowInputs = {
environment: "production",
service: "my-service",
version: "1.4.2",
};
// Encode the inputs
let encodedInputs = JSURL.stringify(workflowInputs);
// Generate the full URL
let workflowIdentifier = "deploy-service";
let triggerIdentifier = "trigger";
let url = `https://app.port.io/self-serve?workflow=${workflowIdentifier}/${triggerIdentifier}&workflowInputs=${encodedInputs}`;
console.log("Workflow URL:", url);
};
If you only want to open the execution form without pre-filling any values, omit workflowInputs entirely:
https://app.port.io/self-serve?workflow=WORKFLOW_IDENTIFIER/TRIGGER_IDENTIFIER
Example
Say you have a "Deploy Service" workflow with identifier deploy-service and a self-service trigger node with identifier trigger that accepts the following inputs:
environment: Target environment (stagingorproduction)service: The service to deployversion: Version tag to deploy
The following code generates a shareable link pre-filled with specific values:
let workflowInputs = {
environment: "production",
service: "my-service",
version: "1.4.2",
};
// Using JSURL to encode
let encodedInputs = JSURL.stringify(workflowInputs);
let url = `https://app.port.io/self-serve?workflow=deploy-service/trigger&workflowInputs=${encodedInputs}`;
The generated URL will open the workflow's execution form, pre-filled with the defined input values.
For complex inputs with special characters, spaces, or nested objects, JSURL encoding handles these cases correctly while keeping the URL compact.
Interactive URL generator
Use this interactive tool to generate the finalized URL without writing any code:
Use workflow URLs in entity properties
Workflow URLs can be used within entity URL properties, allowing developers to trigger workflows directly from the entity page without navigating to the self-service hub.
When an entity property (including calculation properties) contains a valid workflow URL, clicking on it opens the workflow execution form in a modal on the current page.
Example: Dynamic workflow link in a calculation property
You can create a calculation property that generates a workflow URL. For example, a "Deploy Service" link that pre-fills the entity identifier as the service input:
{
"calculationProperties": {
"deployWorkflow": {
"title": "Deploy Service",
"type": "string",
"format": "url",
"calculation": "'https://app.port.io/self-serve?workflow=deploy-service/trigger&workflowInputs=' + (JSURL-encoded inputs)"
}
}
}
Use the workflow inputs parameter with JSURL encoding to create personalized workflow URLs based on the entity's data.
Limitations
- Labeled URLs are not supported: Workflow URLs must be plain URL strings. The labeled-url format (containing both a URL and display text) will not trigger the in-page modal behavior.
- Array consistency: When using an array of URLs, the modal behavior only works if all URLs in the array follow the workflow URL pattern. Mixed arrays (containing both workflow URLs and regular URLs) will not trigger the modal.