{ "_id": "wf_234820e9-807a-44a9-b8cf-d8830ea8257c", "_version": 29, "active": true, "connections": [ { "sourceNodeId": "input", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "prep" }, { "sourceNodeId": "trigger", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "prep" }, { "sourceNodeId": "prep", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "upload" }, { "sourceNodeId": "upload", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "post" }, { "sourceNodeId": "post", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tags_prep" }, { "sourceNodeId": "tags_prep", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tags_loop" }, { "sourceNodeId": "tags_loop", "sourceOutput": "loop", "targetInput": "data", "targetNodeId": "tag_item" }, { "sourceNodeId": "tag_item", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tag_create" }, { "sourceNodeId": "tag_create", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tag_find" }, { "sourceNodeId": "tag_find", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tag_link_old" }, { "sourceNodeId": "tag_link_old", "sourceOutput": "main", "targetInput": "data", "targetNodeId": "tags_loop" }, { "sourceNodeId": "tags_loop", "sourceOutput": "done", "targetInput": "data", "targetNodeId": "out" } ], "consecutiveFailures": 0, "deactivatedReason": "", "groupId": "wfg_07ea58b4-3d38-4633-b6d8-3186355c5f51", "name": "[SWF] zsebhoki - publish anime post", "nodes": [ { "config": { "allowExtra": true, "fields": [ { "description": "The image itself, as the binary object an image node or a download produces", "name": "file", "required": true }, { "description": "Hungarian title", "name": "title_hu", "required": true }, { "description": "English title", "name": "title_en", "required": true }, { "description": "Hungarian body, markdown", "name": "content_hu", "required": true }, { "description": "English body, markdown", "name": "content_en", "required": true }, { "defaultValue": "", "description": "Left empty it is made from the English title. Must be unique on the site", "name": "slug", "required": false }, { "defaultValue": "draft", "description": "draft or published. Draft by default - publishing needs both languages written", "name": "status", "required": false }, { "defaultValue": "", "name": "cover_alt_hu", "required": false }, { "defaultValue": "", "name": "cover_alt_en", "required": false }, { "defaultValue": "https://8xlu0ewmcsjhdu7y.picobaas.eu", "description": "The site. Change to https://zsebhoki.hu once its DNS answers", "name": "baseUrl", "required": false }, { "defaultValue": "png", "description": "Extension for the stored image - png or jpg", "name": "imageExtension", "required": false }, { "defaultValue": [], "description": "Tags as [{slug, name_hu, name_en}]. Each is reused if the slug already exists, then linked to the post.", "name": "tags", "required": false }, { "defaultValue": 0, "description": "1 for 18+ content, 0 for general audience. Required by the blog on every post; it records what the content is, whatever the site-wide check is set to.", "name": "is_adult", "required": false } ] }, "disabled": false, "id": "input", "name": "Workflow Input", "position": { "x": 0, "y": 0 }, "type": "workflow-input" }, { "config": { "label": "Execute" }, "disabled": false, "id": "trigger", "name": "Click Trigger", "position": { "x": 300, "y": 0 }, "type": "click-trigger" }, { "config": { "fields": [ { "name": "slug", "value": "{{($node['Workflow Input'].slug || $node['Workflow Input'].title_en || 'post').toString().toLowerCase().normalize('NFD').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80)}}" }, { "name": "mediaPath", "value": "{{'anime/' + new Date().getFullYear() + '/' + (($node['Workflow Input'].slug || $node['Workflow Input'].title_en || 'post').toString().toLowerCase().normalize('NFD').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60)) + '-' + Date.now() + '.' + ($node['Workflow Input'].imageExtension || 'png')}}" }, { "name": "contentType", "value": "{{($node['Workflow Input'].imageExtension || 'png') === 'jpg' ? 'image/jpeg' : 'image/png'}}" }, { "name": "baseUrl", "value": "{{$node['Workflow Input'].baseUrl}}" } ], "mode": "keep" }, "disabled": false, "id": "prep", "name": "Prepare", "position": { "x": 160, "y": 180 }, "type": "set-fields" }, { "config": { "authType": "credential", "bodyFrom": "file", "contentType": "other", "contentTypeCustom": "{{$node['Prepare'].contentType}}", "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36", "downloadCollection": "downloads", "downloadTtlHours": 24, "failOnErrorStatus": true, "followRedirects": true, "method": "POST", "responseMode": "json", "retries": 2, "retryDelayMs": 2000, "retryMaxDelayMs": 30000, "storeDownload": false, "timeout": 120000, "url": "{{$node['Prepare'].baseUrl}}/api/storage/media/{{$node['Prepare'].mediaPath}}?content_type={{$node['Prepare'].contentType}}" }, "disabled": false, "id": "upload", "name": "Upload Image", "position": { "x": 160, "y": 360 }, "type": "http-request" }, { "config": { "authType": "credential", "body": "{\n \"slug\": \"{{$node['Prepare'].slug}}\",\n \"is_adult\": {{Number($node['Workflow Input'].is_adult) === 1 ? 1 : 0}},\n \"title_hu\": \"{{$node['Workflow Input'].title_hu}}\",\n \"title_en\": \"{{$node['Workflow Input'].title_en}}\",\n \"content_hu\": \"{{$node['Workflow Input'].content_hu}}\",\n \"content_en\": \"{{$node['Workflow Input'].content_en}}\",\n \"status\": \"{{$node['Workflow Input'].status || 'draft'}}\",\n \"cover_file_id\": \"{{data.body.id}}\",\n \"cover_alt_hu\": \"{{$node['Workflow Input'].cover_alt_hu || $node['Workflow Input'].title_hu}}\",\n \"cover_alt_en\": \"{{$node['Workflow Input'].cover_alt_en || $node['Workflow Input'].title_en}}\"\n}", "contentType": "application/json", "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36", "downloadCollection": "downloads", "downloadTtlHours": 24, "failOnErrorStatus": true, "followRedirects": true, "method": "POST", "responseMode": "json", "retries": 1, "retryDelayMs": 1000, "retryMaxDelayMs": 30000, "storeDownload": false, "timeout": 60000, "url": "{{$node['Prepare'].baseUrl}}/api/posts" }, "disabled": false, "id": "post", "name": "Create Post", "position": { "x": 160, "y": 540 }, "type": "http-request" }, { "config": { "fields": [ { "name": "ok", "value": "{{$node['Create Post'].ok}}" }, { "name": "status", "value": "{{$node['Create Post'].statusCode}}" }, { "name": "postId", "value": "{{$node['Create Post'].body.id || ($node['Create Post'].body.data && $node['Create Post'].body.data.id) || ''}}" }, { "name": "slug", "value": "{{$node['Prepare'].slug}}" }, { "name": "coverUrl", "value": "{{$node['Prepare'].baseUrl}}/storage/media/{{$node['Prepare'].mediaPath}}" }, { "name": "url", "value": "{{$node['Prepare'].baseUrl}}/hu/post/{{$node['Prepare'].slug}}" }, { "name": "uploadStatus", "value": "{{$node['Upload Image'].statusCode}}" }, { "name": "error", "value": "{{$node['Create Post'].body.error || $node['Create Post'].body.message || ''}}" } ], "source": "fields" }, "disabled": false, "id": "out", "name": "Workflow Output", "position": { "x": 160, "y": 1800 }, "type": "workflow-output" }, { "config": { "continueOnError": true, "indexVariableName": "index", "inputField": "data.tags", "itemVariableName": "item", "maxIterations": 20, "outputField": "results" }, "disabled": false, "id": "tags_loop", "name": "Each Tag", "position": { "x": 160, "y": 900 }, "type": "loop" }, { "config": { "authType": "credential", "contentType": "application/json", "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36", "downloadCollection": "downloads", "downloadTtlHours": 24, "failOnErrorStatus": true, "followRedirects": true, "method": "GET", "responseMode": "json", "retries": 1, "retryDelayMs": 1000, "retryMaxDelayMs": 30000, "storeDownload": false, "timeout": 30000, "url": "{{$node['Prepare'].baseUrl}}/api/tags?filter[slug]=eq.{{$node['This Tag'].slug}}" }, "disabled": false, "id": "tag_find", "name": "Read Tag Back", "position": { "x": 200, "y": 1340 }, "type": "http-request" }, { "config": { "authType": "credential", "body": "{\n \"slug\": \"{{$node['This Tag'].slug}}\",\n \"name_hu\": \"{{$node['This Tag'].name_hu}}\",\n \"name_en\": \"{{$node['This Tag'].name_en}}\"\n}", "contentType": "application/json", "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36", "downloadCollection": "downloads", "downloadTtlHours": 24, "failOnErrorStatus": false, "followRedirects": true, "method": "POST", "responseMode": "json", "retries": 1, "retryDelayMs": 1000, "retryMaxDelayMs": 30000, "storeDownload": false, "timeout": 30000, "url": "{{$node['Prepare'].baseUrl}}/api/tags" }, "disabled": false, "id": "tag_create", "name": "Create Tag", "position": { "x": 200, "y": 1220 }, "type": "http-request" }, { "config": { "authType": "credential", "body": "{\n \"post_id\": \"{{$node['Create Post'].body.id || ($node['Create Post'].body.data && $node['Create Post'].body.data.id)}}\",\n \"tag_id\": \"{{$node['Read Tag Back'].body.data[0].id}}\"\n}", "contentType": "application/json", "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36", "downloadCollection": "downloads", "downloadTtlHours": 24, "failOnErrorStatus": false, "followRedirects": true, "method": "POST", "responseMode": "json", "retries": 1, "retryDelayMs": 1000, "retryMaxDelayMs": 30000, "storeDownload": false, "timeout": 30000, "url": "{{$node['Prepare'].baseUrl}}/api/post_tags" }, "disabled": false, "id": "tag_link_old", "name": "Link Tag", "position": { "x": 200, "y": 1480 }, "type": "http-request" }, { "config": { "fields": [ { "name": "tags", "value": "{{$node['Workflow Input'].tags || []}}" } ], "mode": "keep" }, "disabled": false, "id": "tags_prep", "name": "Tags To Do", "position": { "x": 160, "y": 720 }, "type": "set-fields" }, { "config": { "fields": [ { "name": "slug", "value": "{{loop.item.slug}}" }, { "name": "name_hu", "value": "{{loop.item.name_hu}}" }, { "name": "name_en", "value": "{{loop.item.name_en}}" } ], "mode": "set" }, "disabled": false, "id": "tag_item", "name": "This Tag", "position": { "x": 200, "y": 1080 }, "type": "set-fields" } ], "ownerId": "usr_dc798bf2-4e5b-4f86-b003-0b9184b2a528", "projectId": "prj_97b218e7-0bc1-41db-aa75-7b9263c876c0", "publishedAt": 1786513551410, "publishedBy": "admin", "publishedVersion": 28, "settings": {}, "updatedAt": 1786207328826 }