swf-zsebhoki-publish-anime-post.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. {
  2. "_id": "wf_234820e9-807a-44a9-b8cf-d8830ea8257c",
  3. "_version": 29,
  4. "active": true,
  5. "connections": [
  6. {
  7. "sourceNodeId": "input",
  8. "sourceOutput": "main",
  9. "targetInput": "data",
  10. "targetNodeId": "prep"
  11. },
  12. {
  13. "sourceNodeId": "trigger",
  14. "sourceOutput": "main",
  15. "targetInput": "data",
  16. "targetNodeId": "prep"
  17. },
  18. {
  19. "sourceNodeId": "prep",
  20. "sourceOutput": "main",
  21. "targetInput": "data",
  22. "targetNodeId": "upload"
  23. },
  24. {
  25. "sourceNodeId": "upload",
  26. "sourceOutput": "main",
  27. "targetInput": "data",
  28. "targetNodeId": "post"
  29. },
  30. {
  31. "sourceNodeId": "post",
  32. "sourceOutput": "main",
  33. "targetInput": "data",
  34. "targetNodeId": "tags_prep"
  35. },
  36. {
  37. "sourceNodeId": "tags_prep",
  38. "sourceOutput": "main",
  39. "targetInput": "data",
  40. "targetNodeId": "tags_loop"
  41. },
  42. {
  43. "sourceNodeId": "tags_loop",
  44. "sourceOutput": "loop",
  45. "targetInput": "data",
  46. "targetNodeId": "tag_item"
  47. },
  48. {
  49. "sourceNodeId": "tag_item",
  50. "sourceOutput": "main",
  51. "targetInput": "data",
  52. "targetNodeId": "tag_create"
  53. },
  54. {
  55. "sourceNodeId": "tag_create",
  56. "sourceOutput": "main",
  57. "targetInput": "data",
  58. "targetNodeId": "tag_find"
  59. },
  60. {
  61. "sourceNodeId": "tag_find",
  62. "sourceOutput": "main",
  63. "targetInput": "data",
  64. "targetNodeId": "tag_link_old"
  65. },
  66. {
  67. "sourceNodeId": "tag_link_old",
  68. "sourceOutput": "main",
  69. "targetInput": "data",
  70. "targetNodeId": "tags_loop"
  71. },
  72. {
  73. "sourceNodeId": "tags_loop",
  74. "sourceOutput": "done",
  75. "targetInput": "data",
  76. "targetNodeId": "out"
  77. }
  78. ],
  79. "consecutiveFailures": 0,
  80. "deactivatedReason": "",
  81. "groupId": "wfg_07ea58b4-3d38-4633-b6d8-3186355c5f51",
  82. "name": "[SWF] zsebhoki - publish anime post",
  83. "nodes": [
  84. {
  85. "config": {
  86. "allowExtra": true,
  87. "fields": [
  88. {
  89. "description": "The image itself, as the binary object an image node or a download produces",
  90. "name": "file",
  91. "required": true
  92. },
  93. {
  94. "description": "Hungarian title",
  95. "name": "title_hu",
  96. "required": true
  97. },
  98. {
  99. "description": "English title",
  100. "name": "title_en",
  101. "required": true
  102. },
  103. {
  104. "description": "Hungarian body, markdown",
  105. "name": "content_hu",
  106. "required": true
  107. },
  108. {
  109. "description": "English body, markdown",
  110. "name": "content_en",
  111. "required": true
  112. },
  113. {
  114. "defaultValue": "",
  115. "description": "Left empty it is made from the English title. Must be unique on the site",
  116. "name": "slug",
  117. "required": false
  118. },
  119. {
  120. "defaultValue": "draft",
  121. "description": "draft or published. Draft by default - publishing needs both languages written",
  122. "name": "status",
  123. "required": false
  124. },
  125. {
  126. "defaultValue": "",
  127. "name": "cover_alt_hu",
  128. "required": false
  129. },
  130. {
  131. "defaultValue": "",
  132. "name": "cover_alt_en",
  133. "required": false
  134. },
  135. {
  136. "defaultValue": "https://8xlu0ewmcsjhdu7y.picobaas.eu",
  137. "description": "The site. Change to https://zsebhoki.hu once its DNS answers",
  138. "name": "baseUrl",
  139. "required": false
  140. },
  141. {
  142. "defaultValue": "png",
  143. "description": "Extension for the stored image - png or jpg",
  144. "name": "imageExtension",
  145. "required": false
  146. },
  147. {
  148. "defaultValue": [],
  149. "description": "Tags as [{slug, name_hu, name_en}]. Each is reused if the slug already exists, then linked to the post.",
  150. "name": "tags",
  151. "required": false
  152. },
  153. {
  154. "defaultValue": 0,
  155. "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.",
  156. "name": "is_adult",
  157. "required": false
  158. }
  159. ]
  160. },
  161. "disabled": false,
  162. "id": "input",
  163. "name": "Workflow Input",
  164. "position": {
  165. "x": 0,
  166. "y": 0
  167. },
  168. "type": "workflow-input"
  169. },
  170. {
  171. "config": {
  172. "label": "Execute"
  173. },
  174. "disabled": false,
  175. "id": "trigger",
  176. "name": "Click Trigger",
  177. "position": {
  178. "x": 300,
  179. "y": 0
  180. },
  181. "type": "click-trigger"
  182. },
  183. {
  184. "config": {
  185. "fields": [
  186. {
  187. "name": "slug",
  188. "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)}}"
  189. },
  190. {
  191. "name": "mediaPath",
  192. "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')}}"
  193. },
  194. {
  195. "name": "contentType",
  196. "value": "{{($node['Workflow Input'].imageExtension || 'png') === 'jpg' ? 'image/jpeg' : 'image/png'}}"
  197. },
  198. {
  199. "name": "baseUrl",
  200. "value": "{{$node['Workflow Input'].baseUrl}}"
  201. }
  202. ],
  203. "mode": "keep"
  204. },
  205. "disabled": false,
  206. "id": "prep",
  207. "name": "Prepare",
  208. "position": {
  209. "x": 160,
  210. "y": 180
  211. },
  212. "type": "set-fields"
  213. },
  214. {
  215. "config": {
  216. "authType": "credential",
  217. "bodyFrom": "file",
  218. "contentType": "other",
  219. "contentTypeCustom": "{{$node['Prepare'].contentType}}",
  220. "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
  221. "downloadCollection": "downloads",
  222. "downloadTtlHours": 24,
  223. "failOnErrorStatus": true,
  224. "followRedirects": true,
  225. "method": "POST",
  226. "responseMode": "json",
  227. "retries": 2,
  228. "retryDelayMs": 2000,
  229. "retryMaxDelayMs": 30000,
  230. "storeDownload": false,
  231. "timeout": 120000,
  232. "url": "{{$node['Prepare'].baseUrl}}/api/storage/media/{{$node['Prepare'].mediaPath}}?content_type={{$node['Prepare'].contentType}}"
  233. },
  234. "disabled": false,
  235. "id": "upload",
  236. "name": "Upload Image",
  237. "position": {
  238. "x": 160,
  239. "y": 360
  240. },
  241. "type": "http-request"
  242. },
  243. {
  244. "config": {
  245. "authType": "credential",
  246. "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}",
  247. "contentType": "application/json",
  248. "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
  249. "downloadCollection": "downloads",
  250. "downloadTtlHours": 24,
  251. "failOnErrorStatus": true,
  252. "followRedirects": true,
  253. "method": "POST",
  254. "responseMode": "json",
  255. "retries": 1,
  256. "retryDelayMs": 1000,
  257. "retryMaxDelayMs": 30000,
  258. "storeDownload": false,
  259. "timeout": 60000,
  260. "url": "{{$node['Prepare'].baseUrl}}/api/posts"
  261. },
  262. "disabled": false,
  263. "id": "post",
  264. "name": "Create Post",
  265. "position": {
  266. "x": 160,
  267. "y": 540
  268. },
  269. "type": "http-request"
  270. },
  271. {
  272. "config": {
  273. "fields": [
  274. {
  275. "name": "ok",
  276. "value": "{{$node['Create Post'].ok}}"
  277. },
  278. {
  279. "name": "status",
  280. "value": "{{$node['Create Post'].statusCode}}"
  281. },
  282. {
  283. "name": "postId",
  284. "value": "{{$node['Create Post'].body.id || ($node['Create Post'].body.data && $node['Create Post'].body.data.id) || ''}}"
  285. },
  286. {
  287. "name": "slug",
  288. "value": "{{$node['Prepare'].slug}}"
  289. },
  290. {
  291. "name": "coverUrl",
  292. "value": "{{$node['Prepare'].baseUrl}}/storage/media/{{$node['Prepare'].mediaPath}}"
  293. },
  294. {
  295. "name": "url",
  296. "value": "{{$node['Prepare'].baseUrl}}/hu/post/{{$node['Prepare'].slug}}"
  297. },
  298. {
  299. "name": "uploadStatus",
  300. "value": "{{$node['Upload Image'].statusCode}}"
  301. },
  302. {
  303. "name": "error",
  304. "value": "{{$node['Create Post'].body.error || $node['Create Post'].body.message || ''}}"
  305. }
  306. ],
  307. "source": "fields"
  308. },
  309. "disabled": false,
  310. "id": "out",
  311. "name": "Workflow Output",
  312. "position": {
  313. "x": 160,
  314. "y": 1800
  315. },
  316. "type": "workflow-output"
  317. },
  318. {
  319. "config": {
  320. "continueOnError": true,
  321. "indexVariableName": "index",
  322. "inputField": "data.tags",
  323. "itemVariableName": "item",
  324. "maxIterations": 20,
  325. "outputField": "results"
  326. },
  327. "disabled": false,
  328. "id": "tags_loop",
  329. "name": "Each Tag",
  330. "position": {
  331. "x": 160,
  332. "y": 900
  333. },
  334. "type": "loop"
  335. },
  336. {
  337. "config": {
  338. "authType": "credential",
  339. "contentType": "application/json",
  340. "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
  341. "downloadCollection": "downloads",
  342. "downloadTtlHours": 24,
  343. "failOnErrorStatus": true,
  344. "followRedirects": true,
  345. "method": "GET",
  346. "responseMode": "json",
  347. "retries": 1,
  348. "retryDelayMs": 1000,
  349. "retryMaxDelayMs": 30000,
  350. "storeDownload": false,
  351. "timeout": 30000,
  352. "url": "{{$node['Prepare'].baseUrl}}/api/tags?filter[slug]=eq.{{$node['This Tag'].slug}}"
  353. },
  354. "disabled": false,
  355. "id": "tag_find",
  356. "name": "Read Tag Back",
  357. "position": {
  358. "x": 200,
  359. "y": 1340
  360. },
  361. "type": "http-request"
  362. },
  363. {
  364. "config": {
  365. "authType": "credential",
  366. "body": "{\n \"slug\": \"{{$node['This Tag'].slug}}\",\n \"name_hu\": \"{{$node['This Tag'].name_hu}}\",\n \"name_en\": \"{{$node['This Tag'].name_en}}\"\n}",
  367. "contentType": "application/json",
  368. "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
  369. "downloadCollection": "downloads",
  370. "downloadTtlHours": 24,
  371. "failOnErrorStatus": false,
  372. "followRedirects": true,
  373. "method": "POST",
  374. "responseMode": "json",
  375. "retries": 1,
  376. "retryDelayMs": 1000,
  377. "retryMaxDelayMs": 30000,
  378. "storeDownload": false,
  379. "timeout": 30000,
  380. "url": "{{$node['Prepare'].baseUrl}}/api/tags"
  381. },
  382. "disabled": false,
  383. "id": "tag_create",
  384. "name": "Create Tag",
  385. "position": {
  386. "x": 200,
  387. "y": 1220
  388. },
  389. "type": "http-request"
  390. },
  391. {
  392. "config": {
  393. "authType": "credential",
  394. "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}",
  395. "contentType": "application/json",
  396. "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
  397. "downloadCollection": "downloads",
  398. "downloadTtlHours": 24,
  399. "failOnErrorStatus": false,
  400. "followRedirects": true,
  401. "method": "POST",
  402. "responseMode": "json",
  403. "retries": 1,
  404. "retryDelayMs": 1000,
  405. "retryMaxDelayMs": 30000,
  406. "storeDownload": false,
  407. "timeout": 30000,
  408. "url": "{{$node['Prepare'].baseUrl}}/api/post_tags"
  409. },
  410. "disabled": false,
  411. "id": "tag_link_old",
  412. "name": "Link Tag",
  413. "position": {
  414. "x": 200,
  415. "y": 1480
  416. },
  417. "type": "http-request"
  418. },
  419. {
  420. "config": {
  421. "fields": [
  422. {
  423. "name": "tags",
  424. "value": "{{$node['Workflow Input'].tags || []}}"
  425. }
  426. ],
  427. "mode": "keep"
  428. },
  429. "disabled": false,
  430. "id": "tags_prep",
  431. "name": "Tags To Do",
  432. "position": {
  433. "x": 160,
  434. "y": 720
  435. },
  436. "type": "set-fields"
  437. },
  438. {
  439. "config": {
  440. "fields": [
  441. {
  442. "name": "slug",
  443. "value": "{{loop.item.slug}}"
  444. },
  445. {
  446. "name": "name_hu",
  447. "value": "{{loop.item.name_hu}}"
  448. },
  449. {
  450. "name": "name_en",
  451. "value": "{{loop.item.name_en}}"
  452. }
  453. ],
  454. "mode": "set"
  455. },
  456. "disabled": false,
  457. "id": "tag_item",
  458. "name": "This Tag",
  459. "position": {
  460. "x": 200,
  461. "y": 1080
  462. },
  463. "type": "set-fields"
  464. }
  465. ],
  466. "ownerId": "usr_dc798bf2-4e5b-4f86-b003-0b9184b2a528",
  467. "projectId": "prj_97b218e7-0bc1-41db-aa75-7b9263c876c0",
  468. "publishedAt": 1786513551410,
  469. "publishedBy": "admin",
  470. "publishedVersion": 28,
  471. "settings": {},
  472. "updatedAt": 1786207328826
  473. }