Knack Trigger Work Around

Hi Guys,

I want to share the below workflow with other n8n / knack users. I got error 400 when trying to share the workflow so posted here instead. The workflow catches data sent from Knack. All the need to do is paste the javascript (in the notes section) into your knack app. This overcomes the issue of no knack trigger in n8n.

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "11891acb-b4a4-4470-a6e2-7f8b49a2df7f",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        642,
        334
      ],
      "webhookId": "11891acb-b4a4-4470-a6e2-7f8b49a2df7f",
      "notes": "Paste the below javascript into the Knack Settings: API & Code > Javascript\n\n                   // Change view_494 is the edit diary page form\n$(document).on('knack-form-submit.view_494', async function(event, view, data) {\n  \n  \n  await $.ajax(\n    {\n      url:\"https://YourWebhookEndPoint\",\n      type:'POST',\n      data: {json: JSON.stringify(data)},\n      dataType: 'json'\n      \n      }\n    )\n\n  });"
    },
    {
      "parameters": {
        "functionCode": "item = JSON.parse(item.body.json);\nreturn item;\n"
      },
      "name": "ParseJson",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        832,
        334
      ],
      "notes": "Parse Json"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "ParseJson",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
2 Likes

@paul2000 thanks for sharing with the community.