|
9 | 9 | "typeVersion": 1, |
10 | 10 | "position": [0, 0] |
11 | 11 | }, |
| 12 | + { |
| 13 | + "parameters": { |
| 14 | + "assignments": { |
| 15 | + "assignments": [ |
| 16 | + { |
| 17 | + "id": "repo-owner", |
| 18 | + "name": "repoOwner", |
| 19 | + "type": "string", |
| 20 | + "value": "your-org" |
| 21 | + }, |
| 22 | + { |
| 23 | + "id": "repo-name", |
| 24 | + "name": "repository", |
| 25 | + "type": "string", |
| 26 | + "value": "your-docs-repo" |
| 27 | + }, |
| 28 | + { |
| 29 | + "id": "workflow-id", |
| 30 | + "name": "workflowId", |
| 31 | + "type": "string", |
| 32 | + "value": "sourcey-build-docs.yml" |
| 33 | + }, |
| 34 | + { |
| 35 | + "id": "workflow-ref", |
| 36 | + "name": "ref", |
| 37 | + "type": "string", |
| 38 | + "value": "main" |
| 39 | + }, |
| 40 | + { |
| 41 | + "id": "fallback-site-url", |
| 42 | + "name": "fallbackSiteUrl", |
| 43 | + "type": "string", |
| 44 | + "value": "https://docs.example.com" |
| 45 | + }, |
| 46 | + { |
| 47 | + "id": "max-pages", |
| 48 | + "name": "maxPages", |
| 49 | + "type": "number", |
| 50 | + "value": 100 |
| 51 | + }, |
| 52 | + { |
| 53 | + "id": "chunk-size", |
| 54 | + "name": "chunkSize", |
| 55 | + "type": "number", |
| 56 | + "value": 4000 |
| 57 | + } |
| 58 | + ] |
| 59 | + } |
| 60 | + }, |
| 61 | + "id": "build-inputs", |
| 62 | + "name": "Build Inputs", |
| 63 | + "type": "n8n-nodes-base.set", |
| 64 | + "typeVersion": 3, |
| 65 | + "position": [240, 0] |
| 66 | + }, |
12 | 67 | { |
13 | 68 | "parameters": { |
14 | 69 | "resource": "workflow", |
15 | 70 | "operation": "dispatch", |
16 | | - "owner": "sourcey", |
17 | | - "repository": "example-docs", |
18 | | - "workflowId": "deploy-docs.yml", |
19 | | - "ref": "main" |
| 71 | + "owner": "={{ $json.repoOwner }}", |
| 72 | + "repository": "={{ $json.repository }}", |
| 73 | + "workflowId": "={{ $json.workflowId }}", |
| 74 | + "ref": "={{ $json.ref }}" |
20 | 75 | }, |
21 | 76 | "id": "dispatch-build", |
22 | 77 | "name": "Dispatch Sourcey Build", |
23 | 78 | "type": "n8n-nodes-base.github", |
24 | 79 | "typeVersion": 1, |
25 | | - "position": [240, 0] |
| 80 | + "position": [480, 0] |
26 | 81 | }, |
27 | 82 | { |
28 | 83 | "parameters": { |
29 | | - "amount": 60, |
30 | | - "unit": "seconds" |
| 84 | + "resume": "webhook", |
| 85 | + "options": {} |
31 | 86 | }, |
32 | | - "id": "wait-for-deploy", |
33 | | - "name": "Wait for Deployment", |
| 87 | + "id": "wait-for-deployment-url", |
| 88 | + "name": "Wait for Deployment URL", |
34 | 89 | "type": "n8n-nodes-base.wait", |
35 | 90 | "typeVersion": 1, |
36 | | - "position": [480, 0] |
| 91 | + "position": [720, 0] |
| 92 | + }, |
| 93 | + { |
| 94 | + "parameters": { |
| 95 | + "assignments": { |
| 96 | + "assignments": [ |
| 97 | + { |
| 98 | + "id": "resolved-site-url", |
| 99 | + "name": "siteUrl", |
| 100 | + "type": "string", |
| 101 | + "value": "={{ $json.deployment_status?.environment_url || $json.deployment?.environment_url || $json.deployment?.payload?.web_url || $json.target_url || $json.fallbackSiteUrl }}" |
| 102 | + }, |
| 103 | + { |
| 104 | + "id": "resolved-max-pages", |
| 105 | + "name": "maxPages", |
| 106 | + "type": "number", |
| 107 | + "value": "={{ $json.maxPages }}" |
| 108 | + }, |
| 109 | + { |
| 110 | + "id": "resolved-chunk-size", |
| 111 | + "name": "chunkSize", |
| 112 | + "type": "number", |
| 113 | + "value": "={{ $json.chunkSize }}" |
| 114 | + } |
| 115 | + ] |
| 116 | + } |
| 117 | + }, |
| 118 | + "id": "deployment-url", |
| 119 | + "name": "Deployment URL", |
| 120 | + "type": "n8n-nodes-base.set", |
| 121 | + "typeVersion": 3, |
| 122 | + "position": [960, 0] |
37 | 123 | }, |
38 | 124 | { |
39 | 125 | "parameters": { |
40 | 126 | "operation": "loadAll", |
41 | | - "siteUrl": "https://example.com/docs", |
| 127 | + "siteUrl": "={{ $json.siteUrl }}", |
42 | 128 | "outputMode": "chunk", |
43 | 129 | "includeContent": true, |
44 | | - "maxPages": 100, |
45 | | - "chunkSize": 4000 |
| 130 | + "maxPages": "={{ $json.maxPages }}", |
| 131 | + "chunkSize": "={{ $json.chunkSize }}" |
46 | 132 | }, |
47 | 133 | "id": "sourcey-load-all", |
48 | 134 | "name": "Sourcey Load All", |
49 | 135 | "type": "n8n-nodes-sourcey.sourcey", |
50 | 136 | "typeVersion": 1, |
51 | | - "position": [720, 0] |
| 137 | + "position": [1200, 0] |
52 | 138 | } |
53 | 139 | ], |
54 | 140 | "connections": { |
55 | 141 | "Manual Trigger": { |
| 142 | + "main": [[{ "node": "Build Inputs", "type": "main", "index": 0 }]] |
| 143 | + }, |
| 144 | + "Build Inputs": { |
56 | 145 | "main": [[{ "node": "Dispatch Sourcey Build", "type": "main", "index": 0 }]] |
57 | 146 | }, |
58 | 147 | "Dispatch Sourcey Build": { |
59 | | - "main": [[{ "node": "Wait for Deployment", "type": "main", "index": 0 }]] |
| 148 | + "main": [[{ "node": "Wait for Deployment URL", "type": "main", "index": 0 }]] |
| 149 | + }, |
| 150 | + "Wait for Deployment URL": { |
| 151 | + "main": [[{ "node": "Deployment URL", "type": "main", "index": 0 }]] |
60 | 152 | }, |
61 | | - "Wait for Deployment": { |
| 153 | + "Deployment URL": { |
62 | 154 | "main": [[{ "node": "Sourcey Load All", "type": "main", "index": 0 }]] |
63 | 155 | } |
64 | 156 | } |
|
0 commit comments