-
-
Notifications
You must be signed in to change notification settings - Fork 177
Python Client
Akram El Assas edited this page Jul 18, 2025
·
2 revisions
Here is a sample Python client client.py
:
import requests
base_url = 'http://localhost:8000/api/v1'
username = 'admin'
password = 'wexflow2018'
workflow_id = 41
def login(user, passwd, stay_connected=False):
url = f'{base_url}/login'
headers = {'Content-Type': 'application/json'}
payload = {
'username': user,
'password': passwd,
'stayConnected': stay_connected
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code != 200:
raise Exception(f'HTTP {response.status_code} - {response.reason}')
return response.json()['access_token']
try:
token = login(username, password)
headers = {
'Authorization': f'Bearer {token}'
}
response = requests.post(f'{base_url}/start?w={workflow_id}', headers=headers)
if response.status_code != 200:
raise Exception(f'HTTP {response.status_code} - {response.reason}')
job_id = response.json()
print(f'Workflow {workflow_id} started successfully. Job ID: {job_id}')
except Exception as e:
print(f'Failed to start workflow {workflow_id}: {e}')
To run the client, use the following command:
py client.py
Copyright © Akram El Assas. All rights reserved.
- Install Guide
- 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