{
  "name": "Sounday: rewrite text to sound human",
  "nodes": [
    {
      "parameters": {},
      "id": "a1",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "t1",
              "name": "text",
              "value": "In today's fast-paced digital landscape, it is important to note that our running shoes for flat feet play a crucial role in comfort.",
              "type": "string"
            },
            {
              "id": "t2",
              "name": "keep",
              "value": "running shoes for flat feet",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a2",
      "name": "Draft (replace with your AI step)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [220, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://sounday.ai/v1/rewrite",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ text: $json.text, keep: $json.keep ? $json.keep.split(',') : [], strength: 'standard' }) }}",
        "options": {
          "timeout": 90000
        }
      },
      "id": "a3",
      "name": "Sounday rewrite",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 0],
      "notes": "Credential: Header Auth with Name 'x-api-key' and Value = your Sounday API key (sd_...)."
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.facts_preserved }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a4",
      "name": "Facts verified?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [660, 0]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Draft (replace with your AI step)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Draft (replace with your AI step)": {
      "main": [
        [
          {
            "node": "Sounday rewrite",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sounday rewrite": {
      "main": [
        [
          {
            "node": "Facts verified?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
