Configuration
A self-service trigger allows users to manually execute a workflow from Port's UI and API. This is useful for creating on-demand operations like provisioning resources, deploying services, or running maintenance tasks.
To configure a self-service trigger node, you define user inputs in the userInputs section. These inputs can include text, numbers, entity selectors, and more. For detailed information about input types and configuration options, see user inputs.
JSON Structure
Here's an example of a self-service trigger node configuration:
{
"identifier": "trigger-node",
"title": "Self-Service Trigger",
"config": {
"type": "SELF_SERVE_TRIGGER",
"userInputs": {
"properties": {
"environment": {
"type": "string",
"title": "Environment",
"enum": ["development", "staging", "production"]
},
"service": {
"type": "string",
"format": "entity",
"blueprint": "service",
"title": "Service"
}
},
"required": ["environment", "service"],
"order": ["service", "environment"]
}
}
}
User Inputs
Each self-service workflow trigger has a userInputs section in its configuration. In this section, you can define all the user inputs you want your developers and users to fill when executing the workflow.
See - User Inputs for more info.
Outputs
The self-service trigger stores user inputs as outputs that can be referenced by subsequent nodes. Outputs are accessed using bracket notation .outputs["<trigger-node-identifier>"].<input_key>.
| Output | Description |
|---|---|
.outputs["<trigger-node-identifier>"].<input_key> | The value of a user input |
Referencing Outputs in Action Nodes
Use JQ expressions wrapped in double curly brackets to reference trigger outputs. In the example below, the trigger node's identifier is trigger:
{
"config": {
"type": "WEBHOOK",
"url": "https://api.example.com/deploy",
"body": {
"environment": "{{ .outputs.trigger.environment }}",
"service": "{{ .outputs.trigger.service }}"
}
}
}
Supported input types
- Text - Basic text input.
- Number - Numeric input.
- Toggle - Boolean true/false.
- Entity - Select an entity from a blueprint.
- User - Select a Port user.
- Team - Select a Port team.
- Datetime - Date and time picker.
- URL - URL input with validation.
- Email - Email input with validation.
- Array - List of values.
- Object - JSON object input.
- YAML - YAML formatted input.
Example
Service deployment workflow
This example demostrates how to create a self-service workflow where users select a service, specify a version, and choose a target environment. The workflow then sends a deployment request with these inputs to an external API.
Service deployment workflow (click to expand)
{
"identifier": "deploy-service",
"title": "Deploy Service",
"icon": "Deployment",
"nodes": [
{
"identifier": "trigger",
"title": "Request Deployment",
"config": {
"type": "SELF_SERVE_TRIGGER",
"userInputs": {
"properties": {
"service": {
"type": "string",
"format": "entity",
"blueprint": "service",
"title": "Service to Deploy"
},
"version": {
"type": "string",
"title": "Version",
"description": "The version tag to deploy"
},
"environment": {
"type": "string",
"title": "Target Environment",
"enum": ["staging", "production"],
"enumColors": {
"staging": "blue",
"production": "green"
}
}
},
"required": ["service", "version", "environment"]
}
}
},
{
"identifier": "deploy-action",
"title": "Trigger Deployment",
"config": {
"type": "WEBHOOK",
"url": "https://api.example.com/deploy",
"method": "POST",
"body": {
"service": "{{ .outputs.trigger.service }}",
"version": "{{ .outputs.trigger.version }}",
"environment": "{{ .outputs.trigger.environment }}"
}
}
}
],
"connections": [
{
"sourceIdentifier": "trigger",
"targetIdentifier": "deploy-action"
}
]
}