Facebook Graph Node

So I have finally got this working… (Facebook make their end of the game very difficult!)

But I wonder if it could be better? Here is how I currently have it running:

  • Created an App in Facebook Developer
  • Authenticated the account as a business account (individual authentication is currently suspended)
  • Requested App permissions to be able to publish to a group (default app permissions are pretty much zero)
  • Made up a Privacy Policy and various other things including having to send a screen video of how the node worked
  • Copied a “long lived” Credential Key from https://developers.facebook.com/tools/debug/accesstoken (Long lived = 2 months so that will need repeating every 2 months)
  • Installed the App in my Group

All that feels a lot a faff. I wonder two things

Could there be an official n8n.io App. Then I’d simply publish their App? No need to set up the App myself, so much simpler. There is no coding in their App publication - just access right granting.

Could the node renew its access credentials its self? I understand the concept in facebook is along the lines of:

You login using a pop-up box (similar to twitter) and get a short lived access key exchanged. Then can request a long lived access key using the short lived key.

Then periodically (?daily) a node can ask for a new long lived key using the old long lived key, update the credentials etc. So you’d only have to intervene if that didn’t work for 2 months and the intervention would be to open credentials, click connect, enter facebook uname/password.

Fully expecting a reply to say “if you tick a box on the node all that happens”!

Haven’t worked out posting pictures via the node yet - but I will come back to that once the basics are up and running.

Warning!
This is a bit of a rant but I do think it sheds some light on why these processes are as complicated as they are. Feel free to ignore/skip this post if you are just looking for technical answers!

I am finding that this type of “while standing on one foot with your right index finger on your nose and singing You’ll Be Back from the musical Hamilton as performed by Brian d’Arcy James (not Jonathon Groff), type (not paste) the 69354 alphanumeric character API key into the proprietary keyboard that you ordered 4-6 weeks ago” process has become the standard in the industry.

I had a very similar experience a few weeks ago attempting to set up a “simple” powershell script (I would have used n8n but there were political reasons around the need to use powershell) to pull data from a database query and store the information in a Google Sheets document. The hoops that I had to jump through (i.e. setting up apps, creating API keys, storing and updating temporary keys, designing a security model, etc.) was far more effort than what should have been required (in my opinion). But, I got the job done in the end. It just all seemed so convoluted.

But then I remembered camp…

When I was a university student, I would spend my summers as a camp counselor at a camp for children. The camp was isolated, being a several hour drive from any real civilization. It was not uncommon for camp staff to arrive in early April and not leave the camp premise until late August.

Every year, we would hear back from camp staff in the fall about how difficult it was returning to school because their university friends “just didn’t get it”. They didn’t know all the inside jokes. They didn’t understand the new meanings we gave to common phrases. They didn’t participate in the lifetime of shared experiences that can occur in 4 months when you are together 24 hours a day, 7 days a week.

And occasionally, university friends would part ways because they no longer recognized the friend they had prior to going to camp.

I think this is what is happening in these organizations with their development teams when they are working on processes for creating access to their services. Because the development teams work together for long periods of time with their sole focus being the services that they are creating, the complex processes that they are putting together becomes second nature to them since they live it all the time. But when we step onto the stage, we also no longer recognize the tools we used before the development team started working on the API because we have not been along for the journey.

And this is why they look at us “outsiders” so strangely when we react negatively to being told to “while standing on one foot with your right index finger on your nose and singing You’ll Be Back from the musical Hamilton as performed by Brian d’Arcy James (not Jonathon Groff), type (not paste) the 69354 alphanumeric character API key into the proprietary keyboard that you ordered 4-6 weeks ago”. It’s simple because they do it a 1000 times every day, often without thinking because it has become a reflex.

It’s not their fault. We just have different sets of experiences and it’s human nature to believe most people’s experiences are the same as (or at least very similar to) our own. And this is where developers can start thinking “why can’t they get this because it is really quite easy” and users start reacting with “why does it have to be so complicated to perform such a simple task”.

Unfortunately, there are no easy answers and I believe that this experience will continue to occur for the foreseeable future. But, do not lose hope because I believe that there is light at the end of the tunnel (and, no, I don’t think it is just another train!).

I believe that it is this exact pain which made people like @jan and others look at the situation and say “there must be a better way”. And I think one of these better ways is n8n! It can take all of that complicated multistep processes away from the end users (who really just want to live their day to day lives, not become coders) and put it back where it belongs, with the developers (who truly understand the process as it is their day to day life!).

So, I guess all of this is to say thanks to the n8n team for all the work they are doing on our behalf to make our lives easier. We realize that it takes a lot of time to compress all of those long complicated processes into a simple Click Here button. We know that for every new integration you put out, there has been 20 new ones added to the Feature Requests list. Your efforts do not go unnoticed.

Thanks.

1 Like

Hey @CALUM_POLWART,

This is an interesting idea that you pose here. This feels a lot like how agents used to work in the client/server realm in the old days (read: “the late '90’s/early 2000’s”) and I don’t think this is an unusual approach to take.

This then poses several questions:

  1. Does the effort to create this “agent” provide enough value to the n8n community to warrant the project or does the maintenance time required to keep these distributed agents running properly just shift the work from one place to another?
  2. If it does provide enough value, is this something that should be looked at more broadly for all platforms/integrations?
  3. If it does not provide enough value, how should these challenges be addressed?

(Yeah, I know! I answered a questions with three more questions! :face_with_raised_eyebrow:)

Oh wow. Someone who loves FB even less than me!

In the ideal world you’d be able to open source the app on FB. Then the community maintain it. But there is actually no code! It’s really just a convoluted set of privallges!

The node improvements I assume can be done by someone and contributed back. I develop a little. Currently this is beyond my scope. Not ruling it out for future.

1 Like

@CALUM_POLWART without have not looked at it, I think you are requesting it’s OAuth2 support for Facebook. Actually this node has to be improved as you still have to define things like HTTP method and the Path which you should not have to define. This should be taken care for you. Can you elaborate on the use case you are interested in so that I can have a look at it? @jan had a discussion about this node here

@Tephlon thanks for such an elaborated response. Was really interesting to read.

1 Like

Yes I think OAuth2 is correct. If I understand correctly, you can “OAuth2” the credentials, but they have a short expiry date. You can then generate a longer life credential. And then you can re-do that every day so that it doesn’t expire.

So the ideal process would be something like:

OAuth2 -> user authenticates -> Short Credential Stored -> Daily Node run -> Updates to Long Credential - I don’t even know if thats possible to update credentials from a node?

With the Graph API Explorer referenced in the link, the longest credential you can have is 2 months, so after 2 months you either need to renew the credential manually or the node will fail (as far as I understand it)

The second half is that for the node to work - you need an “app” in Facebook. It would be easier to install an app that to have to build one.