{
  "name": "Quora Question, Answer & Relationship Dataset Builder (long runs)",
  "nodes": [
    {
      "id": "74b06076-3d48-4b3b-ac19-8e2aac836feb",
      "name": "Run by hand",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "f91f1d96-fe5c-45f1-ad2d-5c9890f77d53",
      "name": "Every day",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "notes": "Activate the workflow to run on this schedule."
    },
    {
      "id": "e46b049a-f621-4338-ace7-83f51b05b837",
      "name": "Start Apify run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/actors/nimbryxo-studio~quora-question-answer-and-relationship-dataset/runs?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"mode\": \"auto\",\n  \"scrapeDepth\": \"detail\",\n  \"startUrls\": [\n    {\n      \"url\": \"https://www.quora.com/What-is-the-meaning-of-life\"\n    }\n  ],\n  \"outputFormat\": \"normalized\",\n  \"dedupeMode\": \"canonical\",\n  \"onlyNewItems\": false,\n  \"includeUnchanged\": true,\n  \"includeFieldEvidence\": true,\n  \"includeUnresolvedEdges\": true,\n  \"includeProfileEdges\": false,\n  \"includeQuestionFollowerEdges\": false,\n  \"includeAnswerUpvoterEdges\": false,\n  \"includeSensitiveRelationshipData\": false,\n  \"includeTargetMetadata\": false,\n  \"includeRelationshipCounts\": false,\n  \"includeSpaceRoleEdges\": false,\n  \"includeSpaceContentEdges\": true,\n  \"maxQuestions\": 10,\n  \"maxAnswersPerQuestion\": 5,\n  \"includeQuestion\": true,\n  \"includeAuthor\": true,\n  \"includeAuthorSnapshot\": false,\n  \"includeTopics\": true,\n  \"includeSpaces\": false,\n  \"includeComments\": false,\n  \"includeEngagementBreakdown\": true,\n  \"includeRelatedContent\": false,\n  \"topCommentsOnly\": false,\n  \"includeReplyGraph\": false,\n  \"includeMedia\": false,\n  \"includeFeedText\": false,\n  \"includeOutboundLinks\": false,\n  \"includeEntityGraph\": false,\n  \"maxCommentsPerAnswer\": 0,\n  \"maxCommentDepth\": 20,\n  \"maxGraphEdges\": 1000,\n  \"includeRawEvidence\": false,\n  \"includeHtml\": false,\n  \"redactSensitiveQueryParams\": true,\n  \"maxItemsPerSource\": 0,\n  \"searchDiscovery\": \"relatedOnly\",\n  \"maxRelatedQuestions\": 0,\n  \"searchResultsPerQuery\": 0,\n  \"maxAnswerPages\": 0,\n  \"maxTopicFeedPages\": 0,\n  \"maxSpaceFeedBundles\": 1,\n  \"includeCommentReplies\": false,\n  \"includeQuoraPlusPreview\": true,\n  \"includeProfileStats\": true,\n  \"includeTopicStats\": true,\n  \"includeSpaceStats\": true,\n  \"includePostStats\": true,\n  \"includeAnswerStats\": true,\n  \"includeTopicFeed\": false,\n  \"includeQuestionAudit\": false,\n  \"includeProfileHistory\": false,\n  \"maxProfileHistoryPages\": 0,\n  \"maxRelationshipPages\": 0\n}",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Actor: nimbryxo-studio/quora-question-answer-and-relationship-dataset. Starts the run and waits up to 60 s for it. Header Auth credential: name Authorization, value Bearer + your Apify token."
    },
    {
      "id": "2eca1afe-dfa0-4b69-a3cc-a82ca3665d33",
      "name": "Run finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "cff722fe-84d7-4843-a49c-68a641612713",
              "leftValue": "={{ ['SUCCEEDED', 'FAILED', 'ABORTED', 'TIMED-OUT'].includes($json.data.status) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "0962b1b2-e607-4c24-aebf-3b5d75f7d01b",
      "name": "Check the run again",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        320
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/actor-runs/{{ $json.data.id }}?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Waits up to 60 s per check, then loops back."
    },
    {
      "id": "bc308a86-4b61-444f-ad13-5632e88e0a9b",
      "name": "Run succeeded?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        780,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "8403c436-93f7-4dcd-a31b-cb68e081277b",
              "leftValue": "={{ $json.data.status === 'SUCCEEDED' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "f489616a-1bb7-43b8-a4e1-9435eee2a57b",
      "name": "Get the results",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -100
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items?clean=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Each record of the run's dataset becomes one n8n item. Connect your destination after this node."
    },
    {
      "id": "e42ba896-54b6-49dd-a814-50ac453bb123",
      "name": "Run did not succeed",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1040,
        100
      ],
      "parameters": {
        "errorMessage": "={{ 'Apify run ' + $json.data.id + ' ended with status ' + $json.data.status }}"
      }
    },
    {
      "id": "3c81db96-8784-4a95-ab5d-bf30a8b2dc53",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -400
      ],
      "parameters": {
        "content": "## Quora Question, Answer & Relationship Dataset Builder: long runs\n\nSource: [nimbryxo-studio/quora-question-answer-and-relationship-dataset](https://apify.com/nimbryxo-studio/quora-question-answer-and-relationship-dataset) on Apify.\n\nFor runs that need more than 5 minutes (the synchronous endpoint answers HTTP 408 after 300 s).\n1. Select the same Header Auth credential (name `Authorization`, value `Bearer YOUR_APIFY_TOKEN`) in the three HTTP Request nodes.\n2. Edit the JSON body of **Start Apify run** to change the input.\n3. Connect your destination after **Get the results**.\n\nGenerated by recipeforagents.com. Validated, not executed: runs are billed to your Apify account.",
        "height": 360,
        "width": 500,
        "color": 6
      }
    }
  ],
  "connections": {
    "Run by hand": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every day": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Apify run": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run finished?": {
      "main": [
        [
          {
            "node": "Run succeeded?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check the run again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the run again": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run succeeded?": {
      "main": [
        [
          {
            "node": "Get the results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run did not succeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
