{ "kind": "open-flow-workflow", "version": 1, "name": "Scheduled AI Influencer Post", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_8105883a119a1c85": { "name": "Post on demand", "kind": "start", "inputDefs": [] }, "n_aaa8301d0862a2e3": { "name": "Post every six hours", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 */6 * * *", "timezone": "UTC" } ] }, "n_002235ea6b2b9a5c": { "inputs": { "niche": { "kind": "value", "value": "Modern Stoicism. You tweet about the greatest stoics, their ideas, their quotes, and how their wisdom applies in today's modern life. You love sharing personal stories and experiences." }, "style": { "kind": "value", "value": "All of your tweets are very personal. " }, "inspiration": { "kind": "value", "value": "Your inspiration comes from tens of books on stoicism, psychology, and how to influence people. Books such as \"Contagious\" by Jonah Bergen, \"How To Be Internet Famous\" by Brendan Cox, \"How to Win Friends and Influence People\" by Dale Carnegie, and \"Influencers and Creators\" by Robert V Kozinets, Ulrike Gretzel, Rossella Gambetti strongly influence the way you write your tweets. " } }, "name": "Prepare influencer profile", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "niche" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "style" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "inspiration" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "prompt" } ], "name": "Prepare influencer profile", "moduleId": "n_bc05ebdfcbea7dd1", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_3aaee46f47169927": { "inputs": { "prompt": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_002235ea6b2b9a5c", "output": "prompt" } ] } }, "name": "Generate the post", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "prompt" } ], "outputs": [ { "description": "The final result produced by the Agent.", "jsonSchema": { "type": "object", "properties": { "tweet": { "type": "string" } }, "required": [ "tweet" ], "additionalProperties": false }, "nullable": false, "handle": "output" } ], "name": "Generate the post", "executor": { "kind": "agent", "code": false, "model": "gpt-4o-mini", "prompt": "{{prompt}}", "maxRounds": 1, "tools": [] } } }, "n_73ab1369a9b846cc": { "inputs": { "result": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3aaee46f47169927", "output": "output" } ] } }, "name": "Check post length", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "tweet": { "type": "string" } }, "required": [ "tweet" ], "additionalProperties": false }, "nullable": false, "handle": "result" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "text" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "tooLong" } ], "name": "Check post length", "moduleId": "n_aad39a0c06cb98c2", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f966e8bb4e19a9c8": { "inputs": {}, "name": "Post exceeds 280 characters", "kind": "condition", "matchMode": "first", "cases": [ { "output": "regenerate", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_73ab1369a9b846cc", "output": "tooLong" } }, "operator": "==", "right": { "kind": "value", "value": true } } ] } ] } ] }, "n_5bc6487e5252e604": { "inputs": { "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_73ab1369a9b846cc", "output": "text" } ] } }, "name": "Publish on X", "kind": "task", "task": { "inputs": [ { "description": "The Tweet text content. Required unless another content source is provided.", "jsonSchema": { "type": "string", "description": "The Tweet text content. Required unless another content source is provided." }, "nullable": true, "handle": "text", "value": null }, { "description": "The card URI to attach to the Tweet.", "jsonSchema": { "type": "string", "description": "The card URI to attach to the Tweet." }, "nullable": true, "handle": "cardUri", "value": null }, { "description": "Whether to mark the Tweet as promoted-only nullcast content.", "jsonSchema": { "type": "boolean", "description": "Whether to mark the Tweet as promoted-only nullcast content." }, "nullable": true, "handle": "nullcast", "value": null }, { "description": "The place ID to attach to the Tweet.", "jsonSchema": { "type": "string", "description": "The place ID to attach to the Tweet." }, "nullable": true, "handle": "geoPlaceId", "value": null }, { "description": "The poll options to create with the Tweet.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "A string value." }, "description": "The poll options to create with the Tweet." }, "nullable": true, "handle": "pollOptions", "value": null }, { "description": "The Tweet ID to quote in the new Tweet.", "jsonSchema": { "type": "string", "description": "The Tweet ID to quote in the new Tweet." }, "nullable": true, "handle": "quoteTweetId", "value": null }, { "description": "Who can reply to the Tweet.", "jsonSchema": { "type": "string", "enum": [ "following", "mentionedUsers", "subscribers" ], "description": "Who can reply to the Tweet." }, "nullable": true, "handle": "replySettings", "value": null }, { "description": "The uploaded media IDs to attach to the Tweet.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "A string value." }, "description": "The uploaded media IDs to attach to the Tweet." }, "nullable": true, "handle": "mediaMediaIds", "value": null }, { "description": "Who can reply to the poll Tweet.", "jsonSchema": { "type": "string", "description": "Who can reply to the poll Tweet." }, "nullable": true, "handle": "pollReplySettings", "value": null }, { "description": "The user IDs to tag in the attached media.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "A string value." }, "description": "The user IDs to tag in the attached media." }, "nullable": true, "handle": "mediaTaggedUserIds", "value": null }, { "description": "The poll duration in minutes.", "jsonSchema": { "type": "integer", "description": "The poll duration in minutes." }, "nullable": true, "handle": "pollDurationMinutes", "value": null }, { "description": "The DM deep link to attach to the Tweet.", "jsonSchema": { "type": "string", "description": "The DM deep link to attach to the Tweet." }, "nullable": true, "handle": "directMessageDeepLink", "value": null }, { "description": "Whether to restrict the Tweet to super followers only.", "jsonSchema": { "type": "boolean", "description": "Whether to restrict the Tweet to super followers only." }, "nullable": true, "handle": "forSuperFollowersOnly", "value": null }, { "description": "The Tweet ID to reply to.", "jsonSchema": { "type": "string", "description": "The Tweet ID to reply to." }, "nullable": true, "handle": "replyInReplyToTweetId", "value": null }, { "description": "The user IDs to exclude from reply mentions.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "A string value." }, "description": "The user IDs to exclude from reply mentions." }, "nullable": true, "handle": "replyExcludeReplyUserIds", "value": null } ], "outputs": [ { "description": "The ID of the created Tweet.", "jsonSchema": { "type": "string", "description": "The ID of the created Tweet." }, "nullable": false, "handle": "id" }, { "description": "The text content of the created Tweet.", "jsonSchema": { "type": "string", "description": "The text content of the created Tweet." }, "nullable": false, "handle": "text" }, { "description": "The edit history Tweet IDs returned by the X API.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "A string value." }, "description": "The edit history Tweet IDs returned by the X API." }, "nullable": true, "handle": "editHistoryTweetIds" }, { "description": "The raw create Tweet response returned by the X API.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "The raw create Tweet response returned by the X API." }, "nullable": false, "handle": "raw" } ], "name": "Publish on X", "executor": { "kind": "connector", "action": "twitter.creation_of_a_post" } } }, "n_65cb47b2ad593551": { "inputs": { "id": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5bc6487e5252e604", "output": "id" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5bc6487e5252e604", "output": "text" } ] } }, "name": "Confirm the post", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "text" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "text" } ], "name": "Confirm the post", "moduleId": "n_3b2b70175980b6e6", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f5f4a4fc329f64dc": { "name": "Return the post", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "text" } ], "outputMappings": { "id": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_65cb47b2ad593551", "output": "id" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_65cb47b2ad593551", "output": "text" } ] } } } }, "edges": [ { "source": "n_8105883a119a1c85", "target": "n_002235ea6b2b9a5c" }, { "source": "n_aaa8301d0862a2e3", "target": "n_002235ea6b2b9a5c" }, { "source": "n_002235ea6b2b9a5c", "target": "n_3aaee46f47169927" }, { "source": "n_3aaee46f47169927", "target": "n_73ab1369a9b846cc" }, { "source": "n_73ab1369a9b846cc", "target": "n_f966e8bb4e19a9c8" }, { "source": "n_f966e8bb4e19a9c8", "target": "n_002235ea6b2b9a5c", "sourceHandle": "regenerate" }, { "source": "n_f966e8bb4e19a9c8", "target": "n_5bc6487e5252e604", "sourceHandle": "otherwise" }, { "source": "n_5bc6487e5252e604", "target": "n_65cb47b2ad593551" }, { "source": "n_65cb47b2ad593551", "target": "n_f5f4a4fc329f64dc" } ] } }, "modules": { "n_bc05ebdfcbea7dd1": { "name": "Prepare influencer profile", "imports": [], "source": "export default function prompt({niche,style,inspiration}){if(!niche||!style||!inspiration)throw new Error('Complete the influencer profile');return{prompt:`You are a successful modern Twitter influencer. Your tweets always go viral.\\nYou have a specific writing style: ${style}\\nYou follow the principles described in your inspiration sources closely and you write your tweets based on that: ${inspiration}\\nYou have a very specific niche: ${niche}\\nAnswer with the viral tweet and nothing else as a response. Keep the tweet within 280 characters. Current date and time are ${new Date().toISOString()}. Add hashtags and emojis where relevant.\\nWrite a tweet that is certain to go viral. Take your time in writing it. Think. Use the vast knowledge you have.\\nReturn JSON with a single tweet string.`};}\n" }, "n_aad39a0c06cb98c2": { "name": "Check post length", "imports": [], "source": "export default function check({result}){const text=result?.tweet;if(typeof text!=='string'||text.length===0)throw new Error('The model did not return a tweet');return{text,tooLong:text.length>280};}\n" }, "n_3b2b70175980b6e6": { "name": "Confirm the post", "imports": [], "source": "export default function receipt({id,text}){if(typeof id!=='string'||!id||typeof text!=='string'||!text)throw new Error('X did not confirm the post; inspect your account before retrying');return{id,text};}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }