Gate and rewrite social posts with TypeSafe Jev and OpenAI GPT-4o mini
Ready for 3.0What this workflow does
This AI workflow has 15 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects OpenAI Chat Model and Telegram. It also calls api.typesafe.ai over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Configure product facts and thresholds (Edit Fields (Set)): sets 9 fields: facts, audience, platform…
- Draft already provided? (If): checks a condition and branches into true / false
- Prepare draft for scoring (Code): runs custom JavaScript code
- Write first draft with OpenAI (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI model (draft)
- Score draft with Jev (HTTP Request): calls api.typesafe.ai (POST)
- Evaluate score and build feedback (Code): runs custom JavaScript code
- Route by decision (Switch): routes items into 3 branches
- Rewrite with feedback using OpenAI (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI model (rewrite)
- Send to Telegram for human review (Telegram): uses Telegram
- Collect final result (Code): runs custom JavaScript code
Services it uses
Other Telegram + OpenAI templates (807)
HTTP calls to: api.typesafe.ai
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (11)
- Manual Trigger
n8n-nodes-base.manualTrigger - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - No Operation, do nothing
n8n-nodes-base.noOp - Telegram
n8n-nodes-base.telegram
From the author
Quick overview This workflow drafts or validates a social post, scores it with TypeSafe Jev against quality and overclaim thresholds, rewrites failing copy with OpenAI up to a set limit, and sends unresolved posts to Telegram for human review before you…