Calculate integration

Hi
Can you probably add a node that mathematics some data from other nodes?

Can you please explain what you want it to do exactly. Maybe with an example. That makes it the easier to make sure that it actually solves your problem when a node like that gets implemented.

For example:
I could get Bitcoin price in USD by API from known source that it don’t has Bitcoin price in CAD. So I could get Bitcoin price from source 1 and get CAD to USD from source 2 and then by calculate node return Bitcoin to CAD price.

This link is useful for explaining my idea I think:

For that actually no special node is needed, that can be done in every parameter in n8n with a simple expression.

Here an example workflow which does exactly what you described above (Bitcoin price conversion from USD to CAD). You can simply copy the code and paste it like that in n8n. It will then create all the nodes.

{
  "nodes": [
    {
      "parameters": {
        "url": "https://api.coindesk.com/v1/bpi/currentprice.json"
      },
      "name": "Bitcoin Price",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        250,
        500
      ]
    },
    {
      "parameters": {
        "url": "https://api.exchangeratesapi.io/latest?symbols=CAD&base=USD"
      },
      "name": "CAD Conversion Rate",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        500
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "number": [
            {
              "name": "bitcoinCad",
              "value": "={{$node[\"CAD Conversion Rate\"].data[\"rates\"][\"CAD\"]*$node[\"Bitcoin Price\"].data[\"bpi\"][\"USD\"][\"rate_float\"]}}"
            }
          ]
        }
      },
      "name": "Calculate CAD Price",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        650,
        500
      ]
    }
  ],
  "connections": {
    "Bitcoin Price": {
      "main": [
        [
          {
            "node": "CAD Conversion Rate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CAD Conversion Rate": {
      "main": [
        [
          {
            "node": "Calculate CAD Price",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
1 Like

It’s really good
It seems that SET NODE do all I think about calculate node that I suggest.

It is actually not really about the Set Node. That can be done on any parameter on any node in n8n if set to Expression. It could for example also have been directly on the “Text” parameter of the Slack Node.