{
  "name": "S2D recipe - typeform-to-pdf",
  "nodes": [
    {
      "id": "c4000000-0000-4000-8000-000000000001",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -540,
        -400
      ],
      "parameters": {
        "width": 600,
        "height": 340,
        "content": "## PDF from a Typeform response\nEach form submission becomes one SourceToDocs run: a document from your Google Docs template, saved to Google Drive as a Doc and a PDF. Gmail then sends the PDF link to the address typed into the form.\n\n**Set up before you activate**\n- Credentials: Typeform on the trigger, a SourceToDocs API token on the SourceToDocs node, Gmail on the Gmail node\n- Typeform Trigger: replace `YOUR_FORM_ID` by picking your form (questions titled Full name, Email, Company, Request; change the expressions if your titles differ)\n- SourceToDocs node: your form response document and its data set with the columns Name, Email, Company, Request, Submitted\n- The Drive folder must be shared so the respondent can open the link\n\nGuide: https://sourcetodocs.com/automations/typeform-to-pdf/"
      }
    },
    {
      "id": "c4000000-0000-4000-8000-000000000002",
      "name": "Typeform Trigger",
      "type": "n8n-nodes-base.typeformTrigger",
      "typeVersion": 1.1,
      "position": [
        -480,
        0
      ],
      "parameters": {
        "authentication": "accessToken",
        "formId": "YOUR_FORM_ID",
        "simplifyAnswers": true,
        "onlyAnswers": true
      }
    },
    {
      "id": "c4000000-0000-4000-8000-000000000003",
      "name": "SourceToDocs",
      "type": "@twovmodules/n8n-nodes-sourcetodocs.sourceToDocs",
      "typeVersion": 1.1,
      "position": [
        -240,
        0
      ],
      "parameters": {
        "resource": "document",
        "operation": "generate",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "rowsFrom": "mapped",
        "mappedDataSetId": "",
        "output": "simplified",
        "options": {},
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Name": "={{ $json['Full name'] }}",
            "Email": "={{ $json['Email'] }}",
            "Company": "={{ $json['Company'] }}",
            "Request": "={{ $json['Request'] }}",
            "Submitted": "={{ $now.toFormat('d LLLL yyyy') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "Company",
              "displayName": "Company",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "Request",
              "displayName": "Request",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            },
            {
              "id": "Submitted",
              "displayName": "Submitted",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      }
    },
    {
      "id": "c4000000-0000-4000-8000-000000000004",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "={{ $('Typeform Trigger').first().json['Email'] }}",
        "subject": "Your request: a copy for your records",
        "emailType": "html",
        "message": "=Here is a copy of what you sent us: {{ $json.deliveries[0].result.pdf_url }}",
        "options": {}
      }
    }
  ],
  "connections": {
    "Typeform Trigger": {
      "main": [
        [
          {
            "node": "SourceToDocs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SourceToDocs": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
