Topic
This article explains how to start a Nintex Workflow Cloud component workflow using an HTTPS request initiated from a PowerShell script. This is useful for integrating workflows into scripts, automation tools, or external systems that support PowerShell.
Instructions
Step 1 – Prepare the Workflow URL and Token
You’ll need the workflow URL and access token for the component workflow you want to start. These are typically provided when you publish the workflow in Nintex Workflow.
$workflowUrl =
"https://[NintexWorkflowTenant]/api/v1/workflow/published/[GuidFoundInWorkflowURL]/instances?token=[Token]"
For example: https://mytenant.workflowcloud.com/dashboard/designer/26bc9b1d-bf79-4bbc-91af-de19f6d56f95/published
Note: Keep your token secure and avoid sharing it publicly.
Step 2 – Set Headers for the Request
Define the headers to indicate that the request body will be in JSON format.
$headers = @{
"Content-Type" = "application/json"
}
Step 3 – Define Input Variables
Set the values for the input variables expected by your workflow. Replace these with actual values as needed.
$integerVariable = 12345 # Replace with your integer value
$stringVariable = "YourStringValue" # Replace with your string value
Step 4 – Construct the Request Body
Create the JSON payload that includes your input variables and optional parameters like callbackUrl or instanceToken.
$body = @{
"startData" = @{
"se_intid" = $integerVariable
"se_startvartext" = $stringVariable
}
"options" = @{
"callbackUrl" = "" # Optionally add a callback URL here
"instanceToken" = "" # Optionally add an instance token
}
} | ConvertTo-Json
Step 5 – Send the HTTPS Request
Use Invoke-RestMethod to send the POST request and start the workflow.
$response = Invoke-RestMethod -Uri $workflowUrl -Method Post -Headers $headers -Body $body
Step 6 – Output the Response
Display the response to verify that the workflow was started successfully.
$response
Additional Information
- Ensure your workflow is published and accessible via the provided URL and token.
- If your workflow requires authentication beyond the token, additional headers may be needed.
- You can use this method in scheduled tasks, CI/CD pipelines, or other automation scenarios.
Related links
