{
  "name": "Media Outreach Workflow",
  "nodes": [
    {
      "parameters": {},
      "name": "Webhook",
      "type": "webhook",
      "position": [100, 300],
      "webhookId": "media-outreach-trigger"
    },
    {
      "parameters": {
        "method": "POST",
        "path": "validate-request"
      },
      "name": "Request Validation",
      "type": "function",
      "position": [250, 300]
    },
    {
      "parameters": {
        "conditions": {
          "routing": [
            {
              "value": "SEARCH_JOURNALISTS",
              "output": "Search Journalists"
            },
            {
              "value": "SEND_PITCH",
              "output": "Send Pitch"
            },
            {
              "value": "SUBMIT_HARO_RESPONSE",
              "output": "Submit HARO Response"
            },
            {
              "value": "TRACK_PITCH_ENGAGEMENT",
              "output": "Track Pitch Engagement"
            }
          ]
        }
      },
      "name": "Outreach Router",
      "type": "switch",
      "position": [400, 300]
    },
    {
      "parameters": {
        "url": "https://api.muckrack.com/v1/journalists/search",
        "method": "GET",
        "authentication": "predefinedCredentialType",
        "credentialsType": "muckRackApi"
      },
      "name": "Search Journalists",
      "type": "httpRequest",
      "position": [550, 200]
    },
    {
      "parameters": {
        "url": "https://api.mailshake.com/v1/campaigns/pitch",
        "method": "POST",
        "authentication": "predefinedCredentialType",
        "credentialsType": "mailshakeApi"
      },
      "name": "Send Pitch",
      "type": "httpRequest",
      "position": [550, 300]
    },
    {
      "parameters": {
        "url": "https://api.helpareporter.com/v1/respond",
        "method": "POST",
        "authentication": "predefinedCredentialType",
        "credentialsType": "haroApi"
      },
      "name": "Submit HARO Response",
      "type": "httpRequest",
      "position": [550, 400]
    },
    {
      "parameters": {
        "url": "https://api.mailshake.com/v1/campaigns/engagement",
        "method": "GET",
        "authentication": "predefinedCredentialType",
        "credentialsType": "mailshakeApi"
      },
      "name": "Track Pitch Engagement",
      "type": "httpRequest",
      "position": [550, 500]
    },
    {
      "parameters": {
        "method": "POST",
        "path": "create-journalist-database"
      },
      "name": "Create Journalist Database",
      "type": "function",
      "position": [700, 300]
    },
    {
      "parameters": {},
      "name": "Error Handling",
      "type": "errorTrigger",
      "position": [900, 300]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Request Validation",
            "type": "main",
            "output": 0
          }
        ]
      ]
    },
    "Request Validation": {
      "main": [
        [
          {
            "node": "Outreach Router",
            "type": "main",
            "output": 0
          }
        ]
      ]
    },
    "Outreach Router": {
      "main": [
        [
          {
            "node": "Search Journalists",
            "type": "main",
            "output": "SEARCH_JOURNALISTS"
          },
          {
            "node": "Send Pitch",
            "type": "main",
            "output": "SEND_PITCH"
          },
          {
            "node": "Submit HARO Response",
            "type": "main",
            "output": "SUBMIT_HARO_RESPONSE"
          },
          {
            "node": "Track Pitch Engagement",
            "type": "main",
            "output": "TRACK_PITCH_ENGAGEMENT"
          }
        ]
      ]
    },
    "Search Journalists": {
      "main": [
        [
          {
            "node": "Create Journalist Database",
            "type": "main",
            "output": 0
          }
        ]
      ]
    },
    "Send Pitch": {
      "main": [
        [
          {
            "node": "Track Pitch Engagement",
            "type": "main",
            "output": 0
          }
        ]
      ]
    },
    "Submit HARO Response": {
      "main": [
        [
          {
            "node": "Create Journalist Database",
            "type": "main",
            "output": 0
          }
        ]
      ]
    },
    "Track Pitch Engagement": {
      "main": [
        [
          {
            "node": "Error Handling",
            "type": "main",
            "output": 1
          }
        ]
      ]
    },
    "Error Handling": {
      "main": [
        []
      ]
    }
  },
  "settings": {
    "errorWorkflow": "Error Handling",
    "saveManualExecutions": true,
    "webhookTimeout": 300
  }
}