{
  "name": "Multi Platform Content Syndication",
  "nodes": [
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_BASE_ID"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_TABLE_ID"
        },
        "filterByFormula": "=IS_SAME({Date}, '{{ $now.format('MM-dd-y') }}', 'day')",
        "returnAll": false,
        "limit": 1,
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        200,
        240
      ],
      "id": "0abe8547-0bdb-44fc-b27d-03964cee648c",
      "name": "Airtable"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -20,
        240
      ],
      "id": "bef5732f-b128-4c21-a17a-0cc3806258b6",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "content": "You are a helpful, intelligent writing assistant.",
              "role": "system"
            },
            {
              "content": "Convert the following post copy into formats for the specified social media platforms. Output in JSON. Each platform is different so make sure you conform to the following specifications. Don't include any backticks (```). Use \\n in place of newlines.\n\nIf Twitter, make it short and punchy (under 280 chars).\n\nIf Instagram, make it short and punchy (under 400 chars).\n\nIf Facebook, leave it medium sized.\n\nIf LinkedIn, make it corporate, longer, and dress it up a bit."
            },
            {
              "content": "Post copy: Small actions, big impact! Recycling isn't just a chore—it's a simple way to make a huge difference. From plastic bottles to cardboard boxes, every item recycled is a step toward a cleaner planet. Let's do our part. Recycle today for a better tomorrow! \n\nPlatforms: Facebook, Instagram, LinkedIn, Twitter"
            },
            {
              "content": "={\"facebook\":\"🌍♻️ Did you know that recycling can significantly reduce waste and conserve natural resources?\\nEvery time we recycle, we're helping to cut down on pollution, save energy, and protect our environment. It's not just about tossing items into the correct bin—it's about making a conscious effort to create a more sustainable future for ourselves and generations to come. Imagine the impact if everyone recycled just one plastic bottle or cardboard box today. These small actions add up to massive change.\\nSo, let's take that extra moment to sort our recyclables, educate others, and lead by example. Together, we can make our planet a cleaner, greener place to live. Let's commit to recycling and make a difference every day!\", \"instagram\":\"Recycling is a game-changer! 🌿 Every item you recycle helps cut pollution, save energy, and protect our planet. It’s not just sorting bins—it’s a conscious step towards a sustainable future for us and future generations. Let’s make it count!\", \"linkedin\":\"Did you know that recycling can significantly reduce waste and conserve natural resources? Every time we recycle, we’re not just disposing of waste correctly; we’re actively contributing to a more sustainable and efficient use of our planet’s resources.\\nIn today’s corporate landscape, sustainability is not just a buzzword—it’s a crucial component of responsible business practices. By integrating recycling into our daily operations, we help cut down on pollution, save energy, and mitigate the impact on our environment.\\nThis is about more than just compliance; it’s about leadership and setting an example for others. Recycling is a tangible way to demonstrate our commitment to corporate social responsibility. It involves making a conscious effort to sort our recyclables, educate our teams, and implement sustainable practices across all levels of our organization.\\nEvery recycled item, whether it’s a plastic bottle, cardboard box, or electronic waste, is a step towards a greener future. Imagine the collective impact if every company made recycling a priority. The benefits extend beyond the environment, fostering a culture of sustainability that resonates with employees, customers, and stakeholders alike. As we strive for innovation and growth, let’s also commit to sustainable practices that ensure a healthier planet for future generations.\\nTogether, we can lead the charge towards a more sustainable, responsible, and prosperous future.\", \"twitter\":\"Recycling cuts waste, saves energy, and reduces pollution. It’s more than just sorting bins—it's about building a sustainable future for all. Every effort counts. 🌍♻️\"}",
              "role": "assistant"
            },
            {
              "content": "=Post copy: {{ $json['Post Copy'] }}\n\nPlatforms: {{ $json.Platforms }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {
          "maxTokens": 4096,
          "temperature": 0.5
        }
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        420,
        240
      ],
      "id": "d91370b5-0167-4ebe-a2fb-731ac91b9bdf",
      "name": "Write Platform-Specific Posts",
      "retryOnFail": true,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Airtable').item.json.Platforms }}",
                    "rightValue": "Instagram",
                    "operator": {
                      "type": "array",
                      "operation": "contains",
                      "rightType": "any"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Instagram"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "b89b9ffe-29dc-47f2-bf1a-297026ae8403",
                    "leftValue": "={{ $('Airtable').item.json.Platforms }}",
                    "rightValue": "Facebook",
                    "operator": {
                      "type": "array",
                      "operation": "contains",
                      "rightType": "any"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Facebook"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "d9619c29-e68f-47d4-8174-dc3b27c18215",
                    "leftValue": "={{ $('Airtable').item.json.Platforms }}",
                    "rightValue": "Linkedin",
                    "operator": {
                      "type": "array",
                      "operation": "contains",
                      "rightType": "any"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Linkedin"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "8a36a1f0-db29-4dc7-abf5-5ccee47b4d02",
                    "leftValue": "={{ $('Airtable').item.json.Platforms }}",
                    "rightValue": "Twitter",
                    "operator": {
                      "type": "array",
                      "operation": "contains",
                      "rightType": "any"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Twitter"
            }
          ]
        },
        "options": {
          "allMatchingOutputs": true
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        1020,
        220
      ],
      "id": "20e27c3b-6b4c-4525-9018-d2bb77889ff1",
      "name": "Switch"
    },
    {
      "parameters": {
        "person": "G09gz59I97",
        "text": "={{ $json.message.content.linkedin }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.linkedIn",
      "typeVersion": 1,
      "position": [
        1340,
        280
      ],
      "id": "dfe58247-ecfe-4c44-bb27-11d0cb27422c",
      "name": "LinkedIn"
    },
    {
      "parameters": {
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 2,
      "position": [
        1340,
        480
      ],
      "id": "bc6d3a3e-2f94-4717-a83d-124c2bcf8158",
      "name": "X"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v17.0",
        "edge": "media",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "image_url"
              },
              {
                "name": "caption"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        1340,
        -80
      ],
      "id": "f1c384b3-031d-49d4-b857-b78623787f8e",
      "name": "Create IG Container"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v17.0",
        "edge": "media_publish",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id"
              },
              {
                "name": "image_url"
              },
              {
                "name": "caption"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        1520,
        -80
      ],
      "id": "cefbf7ff-a21c-4606-b9b1-c7f0d0114384",
      "name": "Post to IG"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v17.0",
        "edge": "photos",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message"
              },
              {
                "name": "url"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [
        1340,
        80
      ],
      "id": "7bcbbd34-2028-49ba-8191-4ba275192dab",
      "name": "Post to Facebook"
    },
    {
      "parameters": {
        "url": "={{ $('Airtable').item.json['Image URL'] }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "media.image"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        800,
        240
      ],
      "id": "cf88bc4f-b92e-4bf4-8120-2793dabbf27e",
      "name": "Download Image"
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable": {
      "main": [
        [
          {
            "node": "Write Platform-Specific Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Platform-Specific Posts": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Create IG Container",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post to Facebook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LinkedIn",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "X",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create IG Container": {
      "main": [
        [
          {
            "node": "Post to IG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}
