How to Upload and Reference Custom Python Libraries in Git Repository for Workflow Steps?

This topic was automatically generated from Slack. You can find the original thread here.

I read a forum post from back in June that was asking about using custom python libraries in workflows and there was a comment suggesting that once the git/projects functionality was launched there would be a way to upload custom library files to the git repo and reference them in code steps in workflows. How would one accomplish this? Is this possible?

Great question Tom, so the Github Sync feature allows you to not only track workflows and folders in your Pipedream Project, but any type of file in your sync’d Github Repository will reflect as well.

The remaining hurdle is bundling Python & Node.js scripts referenced in your workflow’s code steps, so they become true multi-file scripts.

That last part is what’s needed now. Hope this makes sense.

How do I reference something that is not included in the running workflow? Should I be able to just import it like I might do if I had it in the same folder on my local machine? I just did a quick test and this did not work

Correct, that will not work yet.

For python, you can publish an PyPi package of your code that you need to reuse across workflows. For now that is the only workaround available.

In Node.js, we have better private action support. You can publish private actions using the CLI or directly in the workflow builder.

You could also store some reusable code in the Data Store… but :nauseated_face:

It works better for configs if you have some generic code that can work with those configs.