New to pipedream, I just started creating a Workflow that go over my liked tweets, and if they contain media, those medias are uploaded to Google Drive.
I have three steps in my workflow :
A trigger (every 24 hours) on my liked tweets
A custom node.js step to generate, for each tweet, an array of objects containing the URL of the image (I add some parameters to the URL returned by the twitter API to get the large image size) and the name of the file to create on Google Drive (so that they reference the screen name and id of original tweet, instead of a random name)
An “upload file to Google Drive” step that is already available on pipedream. I can make it work, but unfortunately this only process ONE element from my array (one url / filename pair). But my array from the previous steps can contain from 0 and up to 4 elements to save to Google Drive.
I fail to understand what would be the clean way to do this on Pipedream. I’m almost hesitating just making a script from scratch in Python and running it myself on a server. But I’d love to try Pipedream.
Is there a way to create “events” from my custom node.js step, that could serve to run other workflows ? (I’d launch an event per media to serve, and another workflow would catch those event and just run a “upload file to Google Drive” step)
Or is there a way to somehow run a step for each elements on my array ?
Orrr, should I write my own “upload to Google Drive” custom step by taking inspiration on https://github.com/PipedreamHQ/pipedream/blob/master/components/google_drive/actions/upload-file/upload-file.mjs ? And if yes, how would I import the utilities like import googleDrive from “…/…/google_drive.app.mjs”; ?
Being new to Pipedream, and despite looking at some examples, I’m not sure I understand very well how I would easily access the Drive content. I guess there are some helper functions to upload, delete files, etc. but the example of custom Drive script directly calls an API endpoint with axios (idk if it’s the correct route to also upload files). I’d probably even go faster with starting from scratch without pipedream, haha.
So I think I’ll choose the option 1, with 2 workflows. I wouldn’t have thought about sending an HTTP request to… another workflow webhook on pipedream! That’s actually pretty smart.
Is there any downside to doing this instead of having one workflow ? Does it count as double the executions on the quota ? I didn’t check in detail how those executions are counted : is it each step that counts as one, or one entire workflow, etc. ?
I will say the nice thing about using Pipedream’s “Use with any App Name API” action (shown in the screenshot below) is that you don’t have to think about OAuth, handling refresh tokens, or even remembering how to pass tokens in the API request.
Yes, I have no problem with diving in the code (I’m a developer). That’s even the reason I wanted to try pipedream : instead of just exposing pre-built actions and being confined to what is exposed and available, you can just write your own code, but pipedream facilitate all the annoying “auth” part… AND also gives you some practical pre-build steps that you’ll generally need.
Okay so yeah, the fact it doubles the amount of invocations counted isn’t really great. I’d prefer keeping it all in one workflow, then.
My concern was more that… I then need to dive into the Google Drive API and how to implement file upload by calling their endpoint with axios. And pipedream just facilitate the auth process by giving me direct access to the authorization token to pass in my HTTP requests.
I guess if I can see the code of the pre-built action for file upload (I guess it’s accessible somewhere on Github ?) it could give me an idea of how to do it without having to go full dive into Google’s API - which is something I’m not eager to. I’ve already dealt with Google services and it’s always a nightmare of complexity compared to all the other APIs I’ve used in my life
I’m trying to figure out how to upload multiple files to Google Drive, but I’m struggling with implementing the custom logic. Would you mind sharing any resources on how to structure the /upload requests?