This repository contains a simple example project to help you get started with the Restack AI SDK. It demonstrates how to set up a basic workflow and functions using the SDK.
- Python 3.8 or higher
- Poetry (for dependency management)
- Docker (for running the Restack services)
-
Run Restack local engine with Docker:
docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main
-
Open the web UI to see the workflows:
http://localhost:5233
-
Clone this repository:
git clone https://github.com/restackio/examples-python cd examples-python/examples/get-started -
Install dependencies using Poetry:
poetry env use 3.12
poetry shell
poetry install
poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.) -
Run the services:
poetry run dev
This will start the Restack service with the defined workflows and functions.
-
In a new terminal, schedule the workflow:
poetry shell
poetry run schedule
This will schedule the
GreetingWorkflowand print the result. -
Optionally, schedule the workflow to run on a specific calendar or interval:
poetry run calendar
poetry run interval
src/: Main source code directoryclient.py: Initializes the Restack clientfunctions/: Contains function definitionsworkflows/: Contains workflow definitionsservices.py: Sets up and runs the Restack services
schedule_workflow.py: Example script to schedule and run a workflow