Get Url After Edit Image Node

Hi guys, how can i get url after edit image node?

Depends on what exactly you want to do after the image node. Where do you need the URL?

i need url to view it on browser.

Sorry do not understand. Can you please give more background. Like what node would come after it.

i need this image url . so i can send the url to end user and open it to browser using that url.

That image does not have an URL. It only exists in the context of the workflow execution.

Can you maybe go one step back and explain what your workflow is supposed to be doing exactly and how it should work. Like how does it get started and how would the browser ever receive that URL (now assuming it would exist).

i see. how can i upload it to google drive once it edited by edit image node? so i can view the edited image using google drive url.

actually i dont have workflow for this node.I just want to understand how can i get final url after it edited.

The data is only in the workflow. You can imagine it as kind of in memory. So what you can do is to use the Googe Drive Node to upload it there. After it got uploaded will it return the URL of the image on Google Drive. Would work the same for all other services like Dropbox, NextCloud, …

You can also use a Webhook-Node and directly return the image like in this example workflow:

i tried to upload to google drive but i got this error.

i have no idea whats wrong with this.

The expression you set in the binary property is wrong. There goes the name of the binary property that holds the binary data. Probably what you want to set there is the string data.

Can you share your workflow so that I can help you better? Just select all and copy and then paste it here.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://source.unsplash.com/random?island",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        470,
        300
      ]
    },
    {
      "parameters": {
        "operation": "text",
        "text": "test",
        "options": {}
      },
      "name": "Edit Image",
      "type": "n8n-nodes-base.editImage",
      "typeVersion": 1,
      "position": [
        670,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "binaryData": true,
        "name": "random",
        "resolveData": true
      },
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [
        870,
        300
      ],
      "credentials": {
        "googleDriveOAuth2Api": "n8n Google Integration"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

I just ran that workflow and worked perfectly for me. I saw you set the binary property to data in the Google Drive node as I had suggested. If it does not work for your it means that probably the Google Drive node does not have the credentials set correctly.

What error are you seeing?

Lol I forgot to activate the Google Drive API haha. Now Its working .Thank you mate!

Hahaha it happens. Glad that it worked.

btw if you want another user to be able to open the url, you might want to use the operation file:share after uploading the file as by default the url it’s gonna be accesible just by you. The config should look something similar to:

2 Likes

yeah i did like that. :heart_eyes: :heart_eyes: