{
  "id": "aazyxppH3KU3zd1D",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Send Slack alerts for app reviews from Google Play and App Store with DataForSEO",
  "tags": [],
  "nodes": [
    {
      "id": "c80d4a63-1d97-44a9-a1dd-903d58b2b301",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -32,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "bc7e2414-13fb-460d-92e8-55128a26a8ce",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1040,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "23c9131a-abab-40bc-88c7-7996eb9bad7d",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1040,
        336
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "97bcbbef-2235-4b55-9c31-701b52be74d6",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1248,
        0
      ],
      "parameters": {
        "text": "=You have {{ $json.data.length }} new review(s) for {{ $('Get app reviews from Google Play Store').item.json.tasks[0].result[0].title }} in Google Play Store! {{ $json.data.map(item => item.review).join('\\n\\n') }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "select": "user",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "2278005b-2594-49bf-97e5-975f21b33783",
      "name": "Send a message1",
      "type": "n8n-nodes-base.slack",
      "position": [
        1248,
        336
      ],
      "parameters": {
        "text": "=You have {{ $json.data.length }} new review(s) for {{ $('Get app reviews from App Store').item.json.tasks[0].result[0].title }} in App Store! {{ $json.data.map(item => item.review).join('\\n\\n') }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "select": "user",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "2a3a80e2-798e-4792-8a4e-76c330d92da5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -128
      ],
      "parameters": {
        "color": 7,
        "width": 992,
        "height": 304,
        "content": "## Get new Reviews from Google Play Store with DataForSEO\nCreate a DataForSEO connection, specify an App ID, Location and Language"
      },
      "typeVersion": 1
    },
    {
      "id": "b5c69326-5414-4b9a-a26b-237d7a945874",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 992,
        "height": 304,
        "content": "## Get new Reviews from App Store with DataForSEO\nCreate a DataForSEO connection, specify an App ID, Location and Language"
      },
      "typeVersion": 1
    },
    {
      "id": "ad9f7aa6-0628-4261-b6a4-4697f866efe5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -128
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 304,
        "content": "## Send a message to Slack\nCreate a Slack connection, select a recipient of the message."
      },
      "typeVersion": 1
    },
    {
      "id": "99d36659-0837-4209-b928-830a4e1ab7ab",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 304,
        "content": "## Send a message to Slack\nCreate a Slack connection, select a recipient of the message."
      },
      "typeVersion": 1
    },
    {
      "id": "9203973b-adf8-43f1-952c-4ebf2a95d8fd",
      "name": "Get app reviews from Google Play Store",
      "type": "n8n-nodes-dataforseo.dataForSeoAppDataApi",
      "position": [
        208,
        0
      ],
      "parameters": {
        "app_id": "com.duolingo",
        "sort_by": "newest",
        "operation": "get-app-reviews",
        "depth_reviews": 10,
        "language_name": "english",
        "location_name": "united states"
      },
      "credentials": {
        "dataForSeoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ec106c39-2f01-4153-8b15-7099745d34b8",
      "name": "Get app reviews from App Store",
      "type": "n8n-nodes-dataforseo.dataForSeoAppDataApi",
      "position": [
        208,
        336
      ],
      "parameters": {
        "app_id": "570060128",
        "sort_by": "most_recent",
        "resource": "apple",
        "operation": "get-apple-app-reviews",
        "language_name": "english",
        "location_name": "united states",
        "depth_for_reviews": 10
      },
      "credentials": {
        "dataForSeoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7f72014e-4430-4ac5-98c4-7b57ab751f81",
      "name": "Split Out (items)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        416,
        0
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "tasks[0].result[0].items"
      },
      "typeVersion": 1
    },
    {
      "id": "906dfa7f-8770-494a-a393-fbaf8a9af7dc",
      "name": "Split Out (items)1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        400,
        336
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "tasks[0].result[0].items"
      },
      "typeVersion": 1
    },
    {
      "id": "9ef38707-9e37-4a6c-b131-27ed2a95f4d6",
      "name": "Filter only new reviews",
      "type": "n8n-nodes-base.filter",
      "position": [
        624,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f8243ed0-7584-4998-b542-450fc9ac1fc1",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              },
              "leftValue": "={{ new Date($json.timestamp) }}",
              "rightValue": "={{ $now.minus(1, 'day') }}"
            }
          ]
        }
      },
      "typeVersion": 2.3,
      "alwaysOutputData": false
    },
    {
      "id": "55963da6-4e7f-4a2c-ac11-0b0ed1ba6fb4",
      "name": "Filter only new reviews1",
      "type": "n8n-nodes-base.filter",
      "position": [
        608,
        336
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f8243ed0-7584-4998-b542-450fc9ac1fc1",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              },
              "leftValue": "={{ new Date($json.timestamp) }}",
              "rightValue": "={{ $now.minus(2, 'day') }}"
            }
          ]
        }
      },
      "typeVersion": 2.3,
      "alwaysOutputData": false
    },
    {
      "id": "56a02f61-aa27-4e4f-9ca9-b8cea89bc66d",
      "name": "Structure review data for a message",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "66135948-34f8-4749-b6f8-66b4715d9909",
              "name": "review",
              "type": "string",
              "value": "=Review {{ $itemIndex + 1 }}:\nRating: {{ $('Split Out (items)').item.json.rating.value }}\nDate: {{ $('Split Out (items)').item.json.timestamp }}\nText: {{ $('Split Out (items)').item.json.review_text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3f9cc5cf-7396-4e33-986f-45c098e60899",
      "name": "Structure review data for a message1",
      "type": "n8n-nodes-base.set",
      "position": [
        816,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "66135948-34f8-4749-b6f8-66b4715d9909",
              "name": "review",
              "type": "string",
              "value": "=Review {{ $itemIndex + 1 }}:\nRating: {{ $('Split Out (items)1').item.json.rating.value }}\nDate: {{ $('Split Out (items)1').item.json.timestamp }}\nText: {{ $('Split Out (items)1').item.json.review_text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9bd10a12-c702-444b-9a41-265beaec62cf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -64
      ],
      "parameters": {
        "width": 432,
        "height": 560,
        "content": "This workflow checks for new app reviews on Google Play and App Store daily using the DataForSEO App Data API and sends a Slack message for each platform when new reviews are detected.\n\n## How it works\n1. Triggers on a daily schedule.\n2. Fetches the latest app reviews from Google Play using the DataForSEO App Data API.\n3. Filters out only new reviews.\n4. Aggregates new reviews and sends a Slack message with review content.\n5. Repeats the same process for App Store reviews.\n6. Sends a separate Slack message for new App Store reviews.\n\n## Setup steps\n1. Create or select your DataForSEO connection (use your [API login and password](https://app.dataforseo.com/api-access)).\n2. Specify your app ID, location, and language for both Google Play and App Store nodes.\n3. Connect your Slack account.\n4. Select the Slack channel or recipient for each message.\n5. Activate the schedule trigger."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "ba6f62fe-6bf6-4e68-b6b5-28be83a5c3dc",
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        []
      ]
    },
    "Send a message1": {
      "main": [
        []
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get app reviews from Google Play Store",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get app reviews from App Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out (items)": {
      "main": [
        [
          {
            "node": "Filter only new reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out (items)1": {
      "main": [
        [
          {
            "node": "Filter only new reviews1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter only new reviews": {
      "main": [
        [
          {
            "node": "Structure review data for a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter only new reviews1": {
      "main": [
        [
          {
            "node": "Structure review data for a message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get app reviews from App Store": {
      "main": [
        [
          {
            "node": "Split Out (items)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure review data for a message": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure review data for a message1": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get app reviews from Google Play Store": {
      "main": [
        [
          {
            "node": "Split Out (items)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}