Architecture
this outlines the architecture to help contributors understand what components exist and what each does
Spaces
there are three places where code can run
userspace: user-written code. in development it runs locally; when deployed, it runs inside an aws lambda
client: code packaged in the floww-sdk. it’s responsible for invoking the userspace with the correct context
server: backend code that interacts with the database, deploys aws lambdas, and invokes them with the correct context
Components
in addition to the spaces, several components coordinate everything
- workos: authentication provider across cli, admin page, dashboard, etc
- centrifugo: manages websocket connections and broadcasting for live flow triggers
- cli: part of the sdk that provides various commands
- sdk: contains code for actions, plus typings for triggers and providers
- ecr: aws registry storing docker runtimes used by lambdas
- ecr proxy: provides fine-grained access control when pushing images to ecr
Flows
(client) dev
1. prerequisites
- check that the workflow exists
2. execution
- fetch available providers in the namespace
- initialize userspace with provider configs
- execute userspace (returns triggers and provider usage)
verify all used providers are configured
- prompt user if any are missing
- set up event routing to userspace (websocket + local events)
reruns
- code changes (reloads) re-run the flow from step 3
- setting up a provider re-runs the flow from step 1
(client) deploy
1. prerequisites
check that the workflow exists
- if not, prompt the user to create one
2. checks
- fetch available providers in the namespace
- execute userspace (returns triggers and provider usage)
verify all used providers are configured
- prompt user if any are missing
3. deploy
- build the runtime image
- upload runtime image (if missing)
- create runtime (if missing)
- create deployment
reruns
- setting up a provider re-runs the checks flow from step 2
(server) incoming webhook
NOTE
- setting up a provider re-runs the checks flow from step 2