mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
21 lines
502 B
Python
21 lines
502 B
Python
import os
|
|
|
|
import requests
|
|
|
|
base = os.environ.get("FLOW_URL") or os.environ.get("FLOW_SERVER_URL", "")
|
|
flow_id = os.environ.get("FLOW_ID", "")
|
|
api_key = os.environ.get("FLOW_API_KEY", "")
|
|
|
|
headers = {"Content-Type": "application/json", "x-api-key": api_key}
|
|
|
|
payload = {
|
|
"flow_id": flow_id,
|
|
"background": True,
|
|
"stream": False,
|
|
"inputs": {},
|
|
}
|
|
|
|
response = requests.post(f"{base}/v1/workflows", headers=headers, json=payload, timeout=60)
|
|
response.raise_for_status()
|
|
print(response.text)
|