{
  "author": {
    "address": "0xc820da3Ce55C600A6282D2B21083Fe5Aa7E51F3D",
    "signature": "a5dad19f10164b7bba9e9b73f0f727d19f074405bcd4af7a452dfa91467dec9e6e1537a38d2605859b45eadea9adcc4653dc9f849df3bd51574f1e9dcb4e55e31b"
  },
  "available_to_orchestrator": true,
  "changelog": "Created a review-first X and Discord campaign drafter with coordinated copy, factual checks, and automatic X length enforcement.",
  "content_hash": "sha256:1adc8c70a305a04bdbdbae616ae7e16483106305d50b2bfab89320bda6ba00de",
  "created_at": "2026-10-21T17:11:23Z",
  "format": "osaurus.template",
  "format_version": 1,
  "id": "5370A35A-BAE2-4213-A70C-A258F9650C34",
  "kind": "workflow",
  "name": "X and Discord Campaign Drafter",
  "requirements": {
    "knowledge": [],
    "mcp_servers": [],
    "models": [
      {
        "locality": "cloud_allowed",
        "needs_tool_use": false,
        "preferred": "openai-chatgpt/gpt-5.6-sol",
        "slot": "writer",
        "strictness": "preferred"
      }
    ],
    "network": [],
    "notes": {},
    "permissions": [],
    "plugins": [],
    "secrets": []
  },
  "summary": "Turns one topic into coordinated X and Discord drafts for review before publishing.",
  "version": 1,
  "workflow": {
    "edges": [
      {
        "from": "angle",
        "to": "write"
      },
      {
        "from": "write",
        "to": "review"
      },
      {
        "from": "review",
        "to": "limit_x"
      }
    ],
    "examples": [
      {
        "input": {
          "audience": "Busy professionals who travel",
          "call_to_action": "Try offline mode and tell us what you think.",
          "tone": "Friendly",
          "topic": "We launched offline mode in our notes app; changes sync when users reconnect."
        },
        "name": "Product launch"
      },
      {
        "input": {
          "audience": "Current users and Discord community members",
          "call_to_action": "Join us in the Discord events channel.",
          "tone": "Playful",
          "topic": "A free community Q&A with the product team is happening Friday at 3 PM Pacific."
        },
        "name": "Community event"
      },
      {
        "input": {
          "audience": "",
          "call_to_action": "",
          "tone": "Professional",
          "topic": "Share a reminder that thoughtful feedback helps improve the product."
        },
        "name": "Minimal brief"
      }
    ],
    "input_schema": {
      "additionalProperties": false,
      "properties": {
        "audience": {
          "description": "Who you want to reach; leave blank for a general audience.",
          "title": "Audience",
          "type": "string"
        },
        "call_to_action": {
          "description": "What readers should do next; leave blank if no action is needed.",
          "title": "Call to action",
          "type": "string"
        },
        "tone": {
          "default": "Friendly",
          "description": "Choose the voice for both drafts.",
          "enum": [
            "Friendly",
            "Professional",
            "Playful"
          ],
          "title": "Tone",
          "type": "string"
        },
        "topic": {
          "description": "Describe the announcement, idea, or promotion the campaign should cover.",
          "title": "Campaign topic",
          "type": "string"
        }
      },
      "required": [
        "topic",
        "tone"
      ],
      "type": "object",
      "x-order": [
        "topic",
        "audience",
        "tone",
        "call_to_action"
      ]
    },
    "model_slots": [
      {
        "locality": "cloud_allowed",
        "needs_tool_use": false,
        "preferred": "openai-chatgpt/gpt-5.6-sol",
        "slot": "writer",
        "strictness": "preferred"
      }
    ],
    "nodes": [
      {
        "id": "angle",
        "inference": {
          "instructions": "Plan one clear campaign angle that can work on both X and Discord. Use only facts explicitly present in the topic, audience, and call to action. Do not infer benefits, use cases, product qualities, dates, links, offers, or audience traits. The angle should reframe the supplied message, not add claims. Return a short angle summary, a hook, and two to four factual key points. If the audience or call to action is blank, do not assume one.",
          "mode": "generate",
          "model_slot": "writer"
        },
        "input": {
          "audience": "{{input.audience}}",
          "call_to_action": "{{input.call_to_action}}",
          "topic": "{{input.topic}}"
        },
        "kind": "inference",
        "name": "Pick a campaign angle",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "angle": {
              "title": "Angle",
              "type": "string"
            },
            "hook": {
              "title": "Hook",
              "type": "string"
            },
            "points": {
              "items": {
                "type": "string"
              },
              "title": "Key points",
              "type": "array"
            }
          },
          "required": [
            "angle",
            "hook",
            "points"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 2
        },
        "timeout": 120
      },
      {
        "id": "write",
        "inference": {
          "instructions": "Create coordinated drafts for X and Discord using the supplied campaign angle and original topic. Treat every supplied detail as authoritative: preserve dates, times, audience labels, and claims exactly, and never substitute a different group. The X draft must be one complete standalone post no longer than 200 characters including hashtags, with at most two hashtags and no thread. Use only the essential message and call to action. The Discord draft may be longer, should be easy to scan with short paragraphs or bullets, and must feel natural for a community server rather than copied from X. Include the provided call to action only when it is non-empty. Do not invent facts, dates, links, handles, offers, benefits, or quotes. Return only the two ready-to-review draft texts.",
          "mode": "generate",
          "model_slot": "writer"
        },
        "input": {
          "audience": "{{input.audience}}",
          "call_to_action": "{{input.call_to_action}}",
          "campaign_angle": "{{nodes.angle.output.angle}}",
          "hook": "{{nodes.angle.output.hook}}",
          "key_points": "{{nodes.angle.output.points}}",
          "tone": "{{input.tone}}",
          "topic": "{{input.topic}}"
        },
        "kind": "inference",
        "name": "Write both channel drafts",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "discord_draft": {
              "title": "Discord draft",
              "type": "string"
            },
            "x_draft": {
              "title": "X draft",
              "type": "string"
            }
          },
          "required": [
            "x_draft",
            "discord_draft"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 2
        },
        "timeout": 120
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  const original = String(input.x_draft || '').trim();\n  const chars = Array.from(original);\n  if (chars.length <= 280) return { x_draft: original, shortened: false };\n\n  const withoutHashtags = original.replace(/\\s+#\\S+/gu, '').trim();\n  if (Array.from(withoutHashtags).length <= 280) {\n    return { x_draft: withoutHashtags, shortened: true };\n  }\n\n  const slice = Array.from(withoutHashtags).slice(0, 279).join('');\n  const boundary = slice.lastIndexOf(' ');\n  const trimmed = (boundary >= 220 ? slice.slice(0, boundary) : slice).replace(/[\\s,;:!?.-]+$/u, '');\n  return { x_draft: trimmed + '…', shortened: true };\n}",
          "timeout": 30
        },
        "id": "limit_x",
        "input": {
          "x_draft": "{{nodes.review.output.x_draft}}"
        },
        "intent": "Keep X within its limit",
        "kind": "code",
        "name": "Keep X within its limit",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "shortened": {
              "title": "Shortened to fit",
              "type": "boolean"
            },
            "x_draft": {
              "title": "X draft",
              "type": "string"
            }
          },
          "required": [
            "x_draft",
            "shortened"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "id": "review",
        "inference": {
          "instructions": "Act as a strict final editor. Compare both candidate drafts with the original topic, audience, and call to action. Remove or rewrite every claim, benefit, use case, date, link, offer, product detail, or audience trait that is not explicitly supported by those original fields. Preserve all important explicit details such as event dates and times. Keep the X draft concise, standalone, and under 200 characters including at most two hashtags. Keep the Discord draft natural and easy to scan. If the call to action is blank, do not invent one. Return only the two corrected drafts.",
          "mode": "generate",
          "model_slot": "writer"
        },
        "input": {
          "audience": "{{input.audience}}",
          "call_to_action": "{{input.call_to_action}}",
          "candidate_discord": "{{nodes.write.output.discord_draft}}",
          "candidate_x": "{{nodes.write.output.x_draft}}",
          "tone": "{{input.tone}}",
          "topic": "{{input.topic}}"
        },
        "intent": "Fact-check both drafts",
        "kind": "inference",
        "name": "Fact-check both drafts",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "discord_draft": {
              "title": "Corrected Discord draft",
              "type": "string"
            },
            "x_draft": {
              "title": "Corrected X draft",
              "type": "string"
            }
          },
          "required": [
            "x_draft",
            "discord_draft"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 2
        },
        "timeout": 120
      }
    ],
    "output": {
      "campaign_angle": "{{nodes.angle.output.angle}}",
      "discord_draft": "{{nodes.review.output.discord_draft}}",
      "x_draft": "{{nodes.limit_x.output.x_draft}}"
    },
    "output_schema": {
      "additionalProperties": false,
      "properties": {
        "campaign_angle": {
          "title": "Campaign angle",
          "type": "string"
        },
        "discord_draft": {
          "title": "Discord draft",
          "type": "string"
        },
        "x_draft": {
          "title": "X draft",
          "type": "string"
        }
      },
      "required": [
        "campaign_angle",
        "x_draft",
        "discord_draft"
      ],
      "type": "object"
    },
    "requirement_notes": {},
    "secrets": []
  }
}