Skip to content

Commit e4b141b

Browse files
committed
Update email-sender readme
1 parent 3607a9d commit e4b141b

File tree

1 file changed

+98
-45
lines changed

1 file changed

+98
-45
lines changed

email_sender/README.md

Lines changed: 98 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,121 @@ You can schedule two scenarios of the workflow.
1313
- Poetry (for dependency management)
1414
- Docker (for running the Restack services)
1515

16-
## Usage
16+
## Start Restack
1717

18-
1. Run Restack local engine with Docker:
18+
To start the Restack, use the following Docker command:
1919

20-
```bash
21-
docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main
22-
```
20+
```bash
21+
docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main
22+
```
2323

24-
2. Open the web UI to see the workflows:
24+
## Environment variables
2525

26-
```bash
27-
http://localhost:5233
28-
```
26+
Create .env file with: STRIPE_SECRET_KEY and OPENAI_API_KEY
2927

30-
3. Clone this repository:
3128

32-
```bash
33-
git clone https://github.com/restackio/examples-python
34-
cd examples-python/examples/get-started
35-
```
36-
37-
4. Create .env file with: STRIPE_SECRET_KEY and OPENAI_API_KEY
29+
## Start python shell
3830

39-
4. Install dependencies using Poetry:
31+
If using uv:
4032

41-
```bash
42-
poetry env use 3.12
43-
```
33+
```bash
34+
uv venv && source .venv/bin/activate
35+
```
4436

45-
```bash
46-
poetry shell
47-
```
37+
If using poetry:
4838

49-
```bash
50-
poetry install
51-
```
39+
```bash
40+
poetry env use 3.12 && poetry shell
41+
```
5242

53-
```bash
54-
poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.)
55-
```
43+
If using pip:
5644

57-
5. Run the services:
45+
```bash
46+
python -m venv .venv && source .venv/bin/activate
47+
```
5848

59-
```bash
60-
poetry run services
61-
```
49+
## Install dependencies
6250

63-
This will start the Restack service with the defined workflows and functions.
51+
If using uv:
6452

65-
6. In a new terminal, schedule the workflow:
53+
```bash
54+
uv sync
55+
uv run dev
56+
```
6657

67-
```bash
68-
poetry shell
69-
```
58+
If using poetry:
7059

71-
```bash
72-
poetry run schedule
73-
```
60+
```bash
61+
poetry install
62+
poetry run dev
63+
```
64+
65+
If using pip:
66+
67+
```bash
68+
pip install -e .
69+
python -c "from src.services import watch_services; watch_services()"
70+
```
71+
72+
73+
## Run the services:
74+
75+
If using uv:
76+
77+
```bash
78+
uv run services
79+
```
80+
81+
If using poetry:
82+
83+
```bash
84+
poetry run services
85+
```
86+
87+
If using pip:
88+
89+
```bash
90+
python -c "from src.services import run_services; run_services()"
91+
```
92+
93+
## In a new terminal, schedule the workflow:
94+
95+
If using uv:
96+
97+
```bash
98+
uv run schedule
99+
```
100+
101+
If using poetry:
102+
103+
```bash
104+
poetry run schedule
105+
```
106+
107+
If using pip:
108+
109+
```bash
110+
python -c "from schedule_workflow import run_schedule_workflow; run_schedule_workflow()"
111+
```
74112

75113
This will schedule the `SendEmailWorkflow` and print the result.
76114

77-
7. To simulate a flow where the step for sending email fails and the retry is automatically handled by Restack AI use run:
78-
```bash
79-
poetry run schedule_failure
80-
```
115+
### To simulate a flow where the step for sending email fails and the retry is automatically handled by Restack AI use run:
116+
117+
If using uv:
118+
119+
```bash
120+
uv run schedule_failure
121+
```
122+
123+
If using poetry:
124+
125+
```bash
126+
poetry run schedule_failure
127+
```
128+
129+
If using pip:
130+
131+
```bash
132+
python -c "from schedule_workflow_failure import run_schedule_workflow_failure; run_schedule_workflow_failure()"
133+
```

0 commit comments

Comments
 (0)