hi - new to prefect, just reading the docs and see...
# ask-community
b
hi - new to prefect, just reading the docs and see the section on "flow storage", i guess Im trying to follow the developer workflow here... so I code a python file that defines my flow and its tasks... submit this to prefect, and it uses flow storage to actually store that script? (i,e. vs me coding a flow, checking it into git, then deploying my flows to prefect..) I guess Im not sure I'm following this.
k
Hey @bitsofinfo, when a Flow is registered, it gets stored in Github, S3, Docker, etc. During Flow Run execution, Prefect pulls the Flow from Storage and runs it. If users don’t specify any storage, the default is Local storage, which is a serialized version of the Flow stored in the 
.prefect
 folder of your home directory.
This is because Prefect doesn’t hold any of your code, so you just point Prefect where to grab the code during runtime
b
ok, i guess I need to go through some examples, sounds like this is more of a snapshot of my source that is immutable for all runs of a flow. still not totally following.
"so you just point Prefect where to grab the code during runtime"
k
Yeah that’s right. Once you change your Flow source, you need to re-register.
b
i guess that just seems like chicken before the egg to me
so the git repo where I might store the authoritative (under development) copy of my flow source code is != to where perfect stores of snapshot/copy of it for distribution to agents etc
k
so Git storage is slight different but let’s say S3 storage. In order you: 1. Make a file that contains Flow code 2. Register it (the registration uploads a copy to S3). 3. During execution, the agent downloads the code from S3 and runs it.
For Git storage you: 1. Make a file that contains Flow code. 2. Upload it to Github/Bitbucket 3. Register the Flow and point to Github 4. During execution, it will be grabbed from Github 5. If the registered metadata deviates from the Github code significantly, there will be an error
In general, the registration process gets the configuration and metadata of your Flow code, saves it in our database. The agent will hit our API, find there is a Flow to run, download the metadata. In the metadata will be where to grab the Flow code from, and then it will run it. Does that help?
b
yes it does a bit! thanks! still about 1/2 though the docs.... some diagrams (architectural and process) would be quite helpful. Do you guys have any?
k
This community contributed article might help
b
thanks will take a look!