{
  "name": "Build in Public \u2014 Daily Auto-Post",
  "description": "Autonomous daily posts to Twitter/LinkedIn from ship log",
  "nodes": [
    {
      "name": "Schedule",
      "type": "n8n-nodes-base.cron",
      "parameters": {
        "cronExpression": "0 9 * * *",
        "timezone": "UTC"
      }
    },
    {
      "name": "Get Ship Log",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "https://api.meshtool.ai/v1/growth/ships",
        "method": "GET",
        "headers": {
          "Authorization": "Bearer {{MESHTOOL_API_KEY}}"
        }
      }
    },
    {
      "name": "Select Latest Ship",
      "type": "n8n-nodes-base.code",
      "parameters": {
        "code": "const ships = $input.all()[0].json.ships || []\nconst latest = ships[0]\nreturn [{json: {feature: latest.name, impact: latest.impact, type: latest.type}}]"
      }
    },
    {
      "name": "Generate Post",
      "type": "n8n-nodes-base.code",
      "parameters": {
        "code": "const templates = [\n  'Just shipped: {feature}. Built on Claude. {impact}',\n  '{feature} is now live. {impact}. Shipping daily.',\n  'Automated {feature}. Impact: {impact}'\n]\nconst t = templates[Math.floor(Math.random() * templates.length)]\nconst post = t.replace('{feature}', $input.first().json.feature).replace('{impact}', $input.first().json.impact)\nreturn [{json: {post, platforms: ['twitter', 'linkedin']}}]"
      }
    },
    {
      "name": "Post to Twitter",
      "type": "n8n-nodes-base.twitter",
      "parameters": {
        "text": "={{$node[\\\"Generate Post\\\"].json.post}}"
      }
    },
    {
      "name": "Post to LinkedIn",
      "type": "n8n-nodes-base.linkedin",
      "parameters": {
        "text": "={{$node[\\\"Generate Post\\\"].json.post}}"
      }
    },
    {
      "name": "Log Engagement",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "https://api.meshtool.ai/v1/growth/engagement",
        "method": "POST",
        "headers": {
          "Authorization": "Bearer {{MESHTOOL_API_KEY}}"
        },
        "body": {
          "post": "={{$node[\\\"Generate Post\\\"].json.post}}",
          "platforms": "={{$node[\\\"Generate Post\\\"].json.platforms}}",
          "timestamp": "={{new Date().toISOString()}}"
        }
      }
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          "Get Ship Log"
        ]
      ]
    },
    "Get Ship Log": {
      "main": [
        [
          "Select Latest Ship"
        ]
      ]
    },
    "Select Latest Ship": {
      "main": [
        [
          "Generate Post"
        ]
      ]
    },
    "Generate Post": {
      "main": [
        [
          "Post to Twitter",
          "Post to LinkedIn"
        ]
      ]
    },
    "Post to Twitter": {
      "main": [
        [
          "Log Engagement"
        ]
      ]
    },
    "Post to LinkedIn": {
      "main": [
        [
          "Log Engagement"
        ]
      ]
    }
  }
}