1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "workflow_json": {
9 "name": "Demo order sync",
10 "nodes": [
11 {
12 "id": "1",
13 "name": "Webhook",
14 "type": "n8n-nodes-base.webhook",
15 "typeVersion": 1,
16 "position": [
17 0,
18 0,
19 ],
20 "parameters": {
21 "path": "orders",
22 "httpMethod": "POST",
23 },
24 },
25 {
26 "id": "2",
27 "name": "Send to CRM",
28 "type": "n8n-nodes-base.httpRequest",
29 "typeVersion": 4,
30 "position": [
31 250,
32 0,
33 ],
34 "parameters": {
35 "method": "POST",
36 "url": "https://crm.example.com/api/orders",
37 },
38 },
39 ],
40 "connections": { "Webhook": { "main": [[{
41 "node": "Send to CRM",
42 "type": "main",
43 "index": 0,
44 }]] } },
45 "active": True,
46 } }
47
48
49run = client.actor("colt2822/n8n-workflow-autopsy").call(run_input=run_input)
50
51
52print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
53for item in client.dataset(run.default_dataset_id).iterate_items():
54 print(item)
55
56