Mautic integration [GOT CREATED]

Thank you for reply, hope to see good news from you soon.

Because I’m newbie so I investigate current n8n, I’ve installed n8n on a VPS successfully and n8n Version: 0.67.3, I’ve add Google API ok and load data from Google Sheet ok, too. But after add Mautic API, create node Mautic like picture, it shows error: “Mautic Error: Looks like I encountered an error (error #404). If I do it again, please report me to the system administrator”,
Excecute note has the same error, please show me how fix this error. Thanks!

Normally 404 means that something did not get found. So I would expect that the URL in the credentials is maybe not set to the correct value. It should be something like this: https://n8n.mautic.net

Fort the case that this is correctly set already did I google and found this.

It seems like that may be also clearing the cache could help.

1 Like

Thanks for reply, but I’m pretty sure that the credential’s mautic is correct because with this credential I’ve use with zapier ok. I’ve cleaned cache, too.

I am not saying the credentials are incorrect, I am saying that the URL you are using could have the wrong format. It is really just supposed to be like in my example above, without any slash or path.

1 Like

Ah, you’re correct without slash, it’s ok, thank you so much!

Ah great to hear that it works now! Have fun with n8n!

1 Like

I’ve turn the JSON parameters field on and pass the parameters. But is there any ways for Mautic API only check new rows on Google Sheets, not all data from Google Sheets? I’ve think about making a new column in Google Sheet like Updated, after data on Google Sheets push to mautic and update, this column will set to 1 and use IF to filter. But I still not successfully with this idea.

Not sure if I fully understand it. I think you want know how to trigger the workflow every time a Google sheet row is either updated or added. If so, sadly that it’s currently no possible but it’s on our list.

If this does not answer your question. Simply get back to me. We are happy to hep.

One possible workaround would be to save in the static data which row was processed last and then only process the new ones. An example for something simlar can be found here where it does get used to process an RSS-Feed:

So is there any way after specific times, like 3 minute, Workflow auto execute from beginning, not care about Google sheet row is either updated or added? Cron trigger can not do this?

@jan @RicardoE105 I can transfer data to my mautic site like I want. I only have small problem with process with Google Sheet, I’ve extract process with Google Sheet below.
I’ve read thread @jan share above but still don’t know how to apply to Google Sheet, I’ve think about use SET to set a column value to 1 when update value with key is mobile.

Example Sheet here: https://docs.google.com/spreadsheets/d/1xk6QMx30xq9gKbnPOaa3uYQatve3sBPo405dQRmWvkM/edit#gid=319478530

And use this code

{
  "name": "18. Google Sheet marks updated 1 ver 4",
  "nodes": [
{
  "parameters": {},
  "name": "Start",
  "type": "n8n-nodes-base.start",
  "typeVersion": 1,
  "position": [
    140,
    290
  ]
},
{
  "parameters": {
    "sheetId": "1xk6QMx30xq9gKbnPOaa3uYQatve3sBPo405dQRmWvkM",
    "range": "HNExtract!A:G",
    "options": {}
  },
  "name": "GS Read Data",
  "type": "n8n-nodes-base.googleSheets",
  "typeVersion": 1,
  "position": [
    390,
    290
  ],
  "credentials": {
    "googleApi": "n8n API"
  }
},
{
  "parameters": {
    "conditions": {
      "number": [],
      "string": [
        {
          "value1": "={{$node[\"GS Read Data\"].json[\"updated\"]}}",
          "operation": "notEqual",
          "value2": "1"
        }
      ]
    }
  },
  "name": "IF Updated not equal 1",
  "type": "n8n-nodes-base.if",
  "typeVersion": 1,
  "position": [
    650,
    290
  ]
},
{
  "parameters": {
    "values": {
      "boolean": [],
      "string": [
        {
          "name": "updated",
          "value": "1"
        }
      ],
      "number": []
    },
    "options": {}
  },
  "name": "Set Updated 1",
  "type": "n8n-nodes-base.set",
  "typeVersion": 1,
  "position": [
    980,
    270
  ]
},
{
  "parameters": {
    "operation": "update",
    "sheetId": "1xk6QMx30xq9gKbnPOaa3uYQatve3sBPo405dQRmWvkM",
    "range": "HNExtract!A:G",
    "key": "mobile",
    "options": {}
  },
  "name": "GS Updated 1",
  "type": "n8n-nodes-base.googleSheets",
  "typeVersion": 1,
  "position": [
    1140,
    210
  ],
  "credentials": {
    "googleApi": "n8n API"
  }
},
{
  "parameters": {
    "operation": "delete",
    "sheetId": "1xk6QMx30xq9gKbnPOaa3uYQatve3sBPo405dQRmWvkM",
    "toDelete": {
      "rows": []
    }
  },
  "name": "GS Delete",
  "type": "n8n-nodes-base.googleSheets",
  "typeVersion": 1,
  "position": [
    1140,
    420
  ],
  "credentials": {
    "googleApi": "n8n API"
  }
}
  ],
  "connections": {
"Start": {
  "main": [
    [
      {
        "node": "GS Read Data",
        "type": "main",
        "index": 0
      }
    ]
  ]
},
"GS Read Data": {
  "main": [
    [
      {
        "node": "IF Updated not equal 1",
        "type": "main",
        "index": 0
      }
    ]
  ]
},
"IF Updated not equal 1": {
  "main": [
    [
      {
        "node": "Set Updated 1",
        "type": "main",
        "index": 0
      }
    ]
  ]
},
"Set Updated 1": {
  "main": [
    [
      {
        "node": "GS Updated 1",
        "type": "main",
        "index": 0
      },
      {
        "node": "GS Delete",
        "type": "main",
        "index": 0
      }
    ]
  ]
}
  },
  "active": false,
  "settings": {},
  "id": "18"
}

And my problem with duplicated data, Google Sheet update operation only update 1 for first data, second data is not. So I think about improve Delete operation here Improve Google Sheets node operation delete. Can you check this or has another solution for this? Thank you!

Hey @huuich sorry for the late response. not sure if I fully understand what asked but check the example below and it should do the trick. Yes, the Google Sheets delete operation can be improved but in the meantime, you can use the index to delete whatever row you need to. I added an index field to my spreadsheet so that when the data goes to the delete operation can be used to delete the right row.

Example spreadsheet here.

And please next time create another topic since this is a question completely unrelated to Mautic and more about Google Sheets.

As always, if something does not make sense, simply get back to me.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        230,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
        "range": "A:E",
        "options": {
          "valueRenderMode": "FORMATTED_VALUE"
        }
      },
      "name": "GS Read Data",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        510,
        290
      ],
      "credentials": {
        "googleSheetsOAuth2Api": "asasasasasas"
      }
    },
    {
      "parameters": {
        "conditions": {
          "number": [],
          "string": [
            {
              "value1": "={{$node[\"GS Read Data\"].json[\"updated\"]}}",
              "value2": "1"
            }
          ]
        }
      },
      "name": "IF Updated not equal 1",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        800,
        290
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "update",
        "sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
        "range": "A:D",
        "key": "mobile",
        "options": {}
      },
      "name": "GS Read Data1",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1370,
        210
      ],
      "credentials": {
        "googleSheetsOAuth2Api": "asasasasasas"
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "delete",
        "sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
        "toDelete": {
          "rows": [
            {
              "sheetId": 0,
              "startIndex": "={{$node[\"NoOp\"].json[\"index\"]}}"
            }
          ]
        }
      },
      "name": "GS Read Data2",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1380,
        410
      ],
      "credentials": {
        "googleSheetsOAuth2Api": "asasasasasas"
      }
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1050,
        420
      ]
    },
    {
      "parameters": {},
      "name": "NoOp1",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1050,
        210
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "GS Read Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GS Read Data": {
      "main": [
        [
          {
            "node": "IF Updated not equal 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Updated not equal 1": {
      "main": [
        [
          {
            "node": "NoOp1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NoOp": {
      "main": [
        [
          {
            "node": "GS Read Data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NoOp1": {
      "main": [
        [
          {
            "node": "GS Read Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
1 Like

@huuich the additional fields got added by @RicardoE105 and released with [email protected].

1 Like

I’ve updated to 0.70.0 and now mautic has many additional fields. Thank you @RicardoE105 and @jan

P/s: Could you take a look at this question? When has new contact from mautic, add to Google Sheets! - #2 by jan

@RicardoE105 @jan , thanks again for this really helpful integration! :pray:

There is one important action that I am missing, though, and that is “Submit a form to Mautic”.

Use case:

  • A form is submitted somewhere else, e.g. in Typeform
  • The same form fields are now submitted to Mautic
  • Mautic can thus do all the post-processing that is defined for that Mautic form (e.g. start a campaign)

Implementation:

  • “Submit form” is currently not among Mautic’s API methods
  • Instead, a POST request to /form/submit?formId=XX is to be used

So… a bit ugly, but still important. Do you think it can be added?

P.S. Supplemental: GitHub - escopecz/mautic-form-submit: PHP library to forward data to a Mautic form

Welcome to the community @Ekke, glad that you like the integration.

You can easily do that with the HTTP node in the meantime. Did you try it?

Why is that not in the API docs?

https://developer.mautic.org/#introduction

oh, good point about the HTML node - no, didn’t try that yet, but will do!

Why is that not in the API docs?

Because it is not part of the API so far - it was not considered necessary in the beginning and never reviewed ever after. We are currently working towards enhancing the Mautic API, and then it will make sense to add that to n8n too :slight_smile:

Updating here rather than starting a new topic.

I have noticed the “Owner ID” option in the mautic node is not working. Everything esle working as expected but the when I set the the owner id as “3” the update is not made in mautic and the new contact remain ownerless. Not sure if this a big n8n side or mautic side.

@RicardoE105 tagged you as you appear to be the main player behind the mautic node.

Hey @Robm,

Can you open a new topic? This topic is 2 years old now so it could be that there was an api change and we need to update the node or it could be something with the workflow.

1 Like