-
-
Notifications
You must be signed in to change notification settings - Fork 182
PowerShell Client
Akram El Assas edited this page Nov 13, 2025
·
2 revisions
Here is a sample PowerShell client client.ps1:
# Login and get JWT token
$loginPayload = @{
username = 'admin'
password = 'wexflow2018'
stayConnected = $false
} | ConvertTo-Json
$res = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/login" -Method Post -Body $loginPayload -ContentType "application/json"
$token = ($res.Content | ConvertFrom-Json).access_token
# Build headers
$headers = @{
Authorization = "Bearer $token"
"Content-Type" = "application/json"
}
# Start workflow
$workflowId=1
$res = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/start?w=$workflowId" -Method Post -Headers $headers
# Parse JSON response
$jobId = ($res.Content | ConvertFrom-Json)
Write-Host "Workflow $workflowId started successfully. Job ID: $jobId"$xmlFile = "C:\WexflowTesting\Xml\Products.xml"
# Explicitly read the file as plain text with no PowerShell object wrapping
$WorkflowXMLString = [System.IO.File]::ReadAllText($xmlFile)
# Build JSON payload
$xmlFile = "C:\WexflowTesting\Xml\Products.xml"
# Explicitly read the file as plain text with no PowerShell object wrapping
$WorkflowXMLString = [System.IO.File]::ReadAllText($xmlFile)
# Build JSON payload
$jsonPayload = @{
WorkflowId = 138
Variables = @(
@{
Name = "xml"
Value = $WorkflowXMLString
}
)
} | ConvertTo-Json
# Login and get JWT token
$loginPayload = @{
username = 'admin'
password = 'wexflow2018'
stayConnected = $false
} | ConvertTo-Json
$res = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/login" -Method Post -Body $loginPayload -ContentType "application/json"
$token = ($res.Content | ConvertFrom-Json).access_token
# Build headers
$headers = @{
Authorization = "Bearer $token"
"Content-Type" = "application/json"
}
# Start workflow with variables
$res = Invoke-WebRequest -Uri "http://localhost:8000/api/v1/start-with-variables" -Method Post -Headers $headers -Body $jsonPayload
# Parse JSON response
$jobId = ($res.Content | ConvertFrom-Json)
Write-Host "Workflow $workflowId started successfully. Job ID: $jobId"Copyright © Akram El Assas. All rights reserved.
- Install Guide
- Migration Guide to v10.0
- HTTPS/SSL
- Screenshots
- Docker
- Configuration Guide
- Persistence Providers
- Getting Started
- Android App
- Local Variables
- Global Variables
- REST Variables
- Functions
- Cron Scheduling
- Command Line Interface (CLI)
- REST API Reference
- Samples
- Logging
- Custom Tasks
-
Built-in Tasks
- File system tasks
- Encryption tasks
- Compression tasks
- Iso tasks
- Speech tasks
- Hashing tasks
- Process tasks
- Network tasks
- XML tasks
- SQL tasks
- WMI tasks
- Image tasks
- Audio and video tasks
- Email tasks
- Workflow tasks
- Social media tasks
- Waitable tasks
- Reporting tasks
- Web tasks
- Script tasks
- JSON and YAML tasks
- Entities tasks
- Flowchart tasks
- Approval tasks
- Notification tasks
- SMS tasks
- Run from Source
- Fork, Customize, and Sync