Skip to main content

Quick Start

Use the following to deploy a local Flow system using Docker.

Prerequisites

Docker

To get started, you will need to ensure you have Docker installed. This can be on a server or Docker Desktop, either one will work.

Flow CLI

You will also need to have the Flow CLI installed.

Deploy

Clone the Flow repo from GitHub and cd flow.

From the flow cloned directory, run docker compose -p flow up. This will start Postgres, MinIO, and the Flow server:

[+] Running 3/0
⠿ Container flow-postgres-1 Created 0.0s
⠿ Container flow-minio-1 Created 0.0s
⠿ Container flow-backend-1 Created 0.0s
Attaching to flow-backend-1, flow-minio-1, flow-postgres-1
flow-postgres-1 | selecting dynamic shared memory implementation ... posix
flow-postgres-1 | selecting default max_connections ... 100
flow-postgres-1 | selecting default shared_buffers ... 128MB
flow-postgres-1 | selecting default time zone ... UTC
flow-postgres-1 | creating configuration files ... ok
flow-minio-1 | Formatting 1st pool, 1 set(s), 1 drives per set.
flow-postgres-1 | running bootstrap script ... ok
flow-backend-1 | time="2022-07-12T06:19:27Z" level=info msg="starting flow server" address=":7080"
flow-backend-1 | time="2022-07-12T06:19:27Z" level=debug msg="loaded authenticator token"
flow-backend-1 | time="2022-07-12T06:19:27Z" level=info msg="registered service" type=flow.services.info.v1
flow-backend-1 | time="2022-07-12T06:19:27Z" level=info msg="registered service" type=flow.services.workflows.v1
flow-backend-1 | time="2022-07-12T06:19:27Z" level=info msg="registered service" type=flow.services.accounts.v1
flow-backend-1 | time="2022-07-12T06:19:27Z" level=debug msg="waiting for services start"
flow-backend-1 | time="2022-07-12T06:19:27Z" level=debug msg="starting service flow.services.info.v1"
flow-backend-1 | time="2022-07-12T06:19:27Z" level=debug msg="starting service flow.services.accounts.v1"
flow-minio-1 | Copyright: 2015-2022 MinIO, Inc.
flow-minio-1 | License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
flow-minio-1 | Version: RELEASE.2022-07-06T20-29-49Z (go1.18.3 linux/amd64)
flow-minio-1 |
flow-minio-1 | Status: 1 Online, 0 Offline.
flow-minio-1 | Console: http://172.19.0.2:9001 http://127.0.0.1:9001
flow-minio-1 | Documentation: https://docs.min.io

Login

You can now login using the Flow CLI using the default password of flow as shown in the log output above:

fctl login
Username: admin
Password:
login successful
note

If InitialAdminPassword is not specified in the config a random password will be generated and output in the startup initial startup logs.

Your First Workflow

You can now queue a workflow using the Flow CLI:

fctl workflows queue -n hello-world -t dev.ehazlett.flow.example

Use the fctl workflows list command to see workflows:

fctl workflows list
ID                                     NAME          TYPE                        STATUS      CREATED         PRIORITY    DURATION
104d8db7-f87e-468a-90ea-95db38158beb hello-world dev.ehazlett.flow.example PENDING 6 seconds ago NORMAL

Deploy the Processor

We will now deploy the example processor to process the queued workflow.

Generate Service Token

Before deploying the processor, we need to generate a service token. A service token allows the processor to communicate with the Flow workflow API.

fctl accounts generate-service-token
960674e702a73649b6a1e44073846d5bcab0ab296e963dbd50a86aef1b9e338d

Launch the Processor

We can now deploy the processor. In another terminal window, run the following:

docker run \
-ti \
--net=flow_default \
--rm \
ehazlett/flow-workflow-example:latest \
-D -a backend:7080 -t <service-token-from-above>

You should see the processor handle the workflow and output similar to the following:

INFO[0000] flow processor dev.ehazlett.flow.example running on 6d4560fba8da
DEBU[0000] starting workflow handler
DEBU[0020] workflow event: workflow:<id:"573434c5-c0af-4d1c-83a2-a0497956f672" type:"dev.ehazlett.flow.example" name:"hello-world" namespace:"18adba00-d1de-445d-ba49-653566d2ef5b" created_at:<seconds:1656542038 nanos:430393723 > updated_at:<seconds:1656542038 nanos:431075844 > >
INFO[0020] processed workflow 573434c5-c0af-4d1c-83a2-a0497956f672

Success!

Congratulations! You have successfully deployed Flow and created your first workflow. Continue on with Concepts to learn more about the Flow features.