<@ULVA73B9P> can Automations work if I don't start...
# ask-marvin
k
@Marvin can Automations work if I don't start background services?
m
thought for 826.5 seconds
Short answer: No. Automations require the server’s background services to be running. - Automations are evaluated server-side by the “triggers” services (reactive and proactive). If you start Prefect Server with
--no-services
, those consumers don’t run, so automations will not fire. - Workers do not evaluate automations; they only execute runs after the server creates them. What to do instead: - Start the server normally so services run:
prefect server start
(no
--no-services
) - If you’re self-hosting and customizing services, ensure the triggers service is enabled (defaults to on). Helpful links: - Event-driven automations (concepts) - prefect server start (CLI) - Triggers services (API) - Settings reference Are you on Prefect Cloud or running a self-hosted Server? If self-hosted, I can help you confirm the right services are enabled.
k
@Marvin It's self-hosted, I start prefect with
uvicorn --factory prefect.server.api.server:create_app
m
thought for 75.8 seconds
Got it — since you’re starting only the API with uvicorn, Automations won’t run. Automations are evaluated by the server’s background “triggers” services, which are not started by uvicorn. Two ways to make Automations work: Option A: Let Prefect run both API and services - Run:
Copy code
prefect server start
- Avoid
--no-services
— that disables Automations. - Docs: prefect server (CLI) Option B: Keep using uvicorn for the API, and start services separately - Keep your API:
Copy code
uvicorn --factory prefect.server.api.server:create_app
- Start services in a sidecar/background process:
Copy code
prefect server services start --background
- Verify they’re running:
Copy code
prefect server services ls
Notes: - The triggers services (reactive/proactive) must be enabled (they are by default). If you customize settings, ensure triggers remain on; see Settings reference. - Workers do not evaluate automations; they only execute runs once the server triggers them. Helpful links: - Event-driven automations (concepts) - Server CLI (start/services) - Triggers services API If you want, share how you’re deploying (systemd, Docker, Kubernetes) and I can suggest a sane process layout to run uvicorn + services together.
k
@Marvin Can I use background services without redis?
m
thought for 163.2 seconds
Yes. You can run Prefect’s background services without Redis. - In a typical single-server setup, services (Triggers, Scheduler, etc.) run fine with the default in-memory messaging and your Prefect Server database (Postgres). Redis is not required. - Just start the services alongside your uvicorn API:
Copy code
prefect server services start --background
- Verify:
Copy code
prefect server services ls
When you might want Redis: - If you run multiple API/service processes across hosts or need higher-throughput/shared messaging, you can add the Redis integration and point the event bus to Redis. Otherwise, you can skip it. Links: - Self-hosted server overview - Server CLI (services) - Prefect Redis integration Are you planning to run multiple API/service replicas, or just a single instance? I can suggest a concrete setup based on that.