{"id":"Y5URlIlbX4HDzWKA","meta":{"instanceId":"workflow-d3eadf4d","versionId":"1.0.0","createdAt":"2025-09-29T07:07:55.724749","updatedAt":"2025-09-29T07:07:55.724767","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"airflow dag_run","nodes":[{"id":"0d4457ef-7a88-4755-8bd2-b0e8148f86f4","name":"Airflow: dag_run","type":"n8n-nodes-base.httpRequest","position":[380,-40],"parameters":{"url":"{{ $env.BASE_URL }}","method":"POST","options":{},"jsonBody":"={\n  \"conf\": {{ $('in data').item.json.conf }}\n}","sendBody":true,"specifyBody":"json","authentication":"{{ $credentials.genericCredentialType }}","genericAuthType":"httpBasicAuth"},"credentials":{"httpBasicAuth":{"id":"vTR4WWA7czRn2ULn","name":"Airflow"}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"acf477a0-aad5-402a-a5a0-543f3e277333","name":"Airflow: dag_run - state","type":"n8n-nodes-base.httpRequest","position":[840,60],"parameters":{"url":"{{ $env.BASE_URL }}","options":{},"authentication":"{{ $credentials.genericCredentialType }}","genericAuthType":"httpBasicAuth"},"credentials":{"httpBasicAuth":{"id":"vTR4WWA7czRn2ULn","name":"Airflow"}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"26982a6f-6281-4140-a05c-ea6f3f2c0cb2","name":"count","type":"n8n-nodes-base.code","position":[1180,40],"parameters":{"jsCode":"try {\n  $('count').first().json.count += 1\n  return {count:$('count').first().json.count};\n}\ncatch (error) {\n  return {count:1};\n}"},"typeVersion":2,"notes":"This code node performs automated tasks as part of the workflow."},{"id":"613718f6-ba7e-415c-8e07-0123224e1ac6","name":"dag run fail","type":"n8n-nodes-base.stopAndError","position":[1180,400],"parameters":{"errorMessage":"dag run fail"},"typeVersion":1,"notes":"This stopAndError node performs automated tasks as part of the workflow."},{"id":"66ba0e85-4608-418b-b27b-8cbc50f78319","name":"if state == queued","type":"n8n-nodes-base.if","position":[520,60],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"0ae67986-09c0-443d-9262-075bfe94ca2e","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.state }}","rightValue":"queued"}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"92176e9a-0ea7-48b0-9ca0-ea4ea8442cee","name":"dag run wait too long","type":"n8n-nodes-base.stopAndError","position":[1500,40],"parameters":{"errorMessage":"dag run wait too long"},"typeVersion":1,"notes":"This stopAndError node performs automated tasks as part of the workflow."},{"id":"6a05471f-232e-44d6-9dbb-583400537507","name":"Airflow: dag_run - get result","type":"n8n-nodes-base.httpRequest","position":[1180,-140],"parameters":{"url":"{{ $env.BASE_URL }}","options":{},"authentication":"{{ $credentials.genericCredentialType }}","genericAuthType":"httpBasicAuth"},"credentials":{"httpBasicAuth":{"id":"vTR4WWA7czRn2ULn","name":"Airflow"}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"fb2211d5-cef2-4be2-b281-de315aa07093","name":"Switch: state","type":"n8n-nodes-base.switch","position":[980,-40],"parameters":{"rules":{"values":[{"outputKey":"YOUR_CREDENTIAL_HERE","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"4d4ecf8a-c02b-4722-9528-1919cdf9b83e","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.state }}","rightValue":"success"}]},"renameOutput":true},{"outputKey":"YOUR_CREDENTIAL_HERE","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.state }}","rightValue":"queued"}]},"renameOutput":true},{"outputKey":"YOUR_CREDENTIAL_HERE","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"fa5d8524-334a-4ab1-b543-bba75cafd0ec","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.state }}","rightValue":"running"}]},"renameOutput":true},{"outputKey":"YOUR_CREDENTIAL_HERE","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"dd853677-c51c-4c06-8680-3c9d1829d6bd","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.state }}","rightValue":"failed"}]},"renameOutput":true}]},"options":{"fallbackOutput":3}},"typeVersion":3.2,"notes":"This switch node performs automated tasks as part of the workflow."},{"id":"5941496a-a64d-432c-9103-e7bcae4b8d67","name":"in data","type":"n8n-nodes-base.executeWorkflowTrigger","position":[100,-40],"parameters":{"workflowInputs":{"values":[{"name":"dag_id"},{"name":"task_id"},{"name":"conf"},{"name":"wait","type":"number"},{"name":"wait_time","type":"number"}]}},"typeVersion":1.1,"notes":"This executeWorkflowTrigger node performs automated tasks as part of the workflow."},{"id":"e77fed4a-b61a-4126-8be3-43ef8a832cfe","name":"Wait","type":"n8n-nodes-base.wait","position":[700,-40],"webhookId":"3d164954-2926-4174-afc1-261dfdfa9e46","parameters":{"amount":"={{ $('in data').item.json.hasOwnProperty('wait') ? $('in data').item.json.wait : 10 }}"},"typeVersion":1.1,"notes":"This wait node performs automated tasks as part of the workflow."},{"id":"8ffae842-4400-4667-85bb-50644ef10fc0","name":"If count > wait_time","type":"n8n-nodes-base.if","position":[1320,140],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"1829d538-5633-4f5c-ad1b-285b084b35ee","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.count }}","rightValue":"={{ $('in data').item.json.hasOwnProperty('wait_time') ? $('in data').item.json.wait_time : 12 }}"}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"c49d4a1b-6f25-471b-9c21-d3defb709dda","name":"airflow-api","type":"n8n-nodes-base.set","position":[240,60],"parameters":{"options":{},"assignments":{"assignments":[{"id":"40a5ab5b-dee1-44c4-910a-d6b85af75aed","name":"prefix","type":"string","value":"{{ $env.API_BASE_URL }}"}]}},"typeVersion":3.4,"notes":"This set node performs automated tasks as part of the workflow."}],"active":false,"settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"versionId":"57fdbcfc-7950-4aff-9ac7-3c2a99a2c8c8","connections":{"Airflow: dag_run":{"main":[[],[],[],[],[],[],[],[]]},"Airflow: dag_run - state":{"main":[[],[],[],[],[],[],[],[]]},"Airflow: dag_run - get result":{"main":[[],[],[],[],[],[],[],[]]}},"description":"Automated workflow: airflow dag_run. This workflow processes data and performs automated tasks.","notes":"Excellent quality workflow: airflow dag_run. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}