Hi Everyone, We are using Prefect's imperative AP...
# ask-community
o
Hi Everyone, We are using Prefect's imperative API , and wanted to use the GitHub storage option. All the tutorials refer to the use of the functional APIs when registering and storing script based Flows. If anyone can point me in the right direction this will be really appreciated
y
Hello Omar - good question, and thanks for pointing out the tutorial is written for functional API.
So to add details to your question, is the bottleneck on loading flow dependencies from storage? Assuming that you’re able to load the task from GitHub storage, but the logic is still defined in your execution files see kevin’s comment below
k
Hey @Omar Sultan, it would just be the
flow.storage = GitHub(…)
also with the imperative API.
y
I think @Kevin Kho get it right here. Once your flow is defined in your file - you can “imported” it with Prefect Storage - doesn’t matter if it’s defined with functional API or imperative API, same flow object in the end.
o
Thanks guys for the update, I gave it a try with the option @Kevin Kho proposed. I was getting errors when trying to run the flow from another agent. We were short on time so didn't get a chance to debug this further. We went with the webhook option and are now storing them in data platform's shared storage so our API and its working perfectly
will try again the github option at a later stage in the project but for now , i think we will stick with the Webhook option
k
Are you doing something like this ? The authentication should be a string of the Secret name.