py-worker environment
Generation copies .env.example to .env; config.py loads it with
python-dotenv. Variables already set in the environment win.
| Variable | What to set |
|---|---|
HOME_PATH | Absolute path to this project. input/, output/ and logs/ are resolved beneath it, so a relative value silently writes to the wrong place. Production: input/ and output/ resolve beneath it. |
DB_HOST | The same database your API owns. The SQLAlchemy models here are hand-written and must be kept in step with its schema by hand — nothing checks this. Production: The API's database host. Must be the API's database. See PostgreSQL. |
DB_PORT | The same database your API owns. The SQLAlchemy models here are hand-written and must be kept in step with its schema by hand — nothing checks this. Production: 5432. |
DB_USER | The same database your API owns. The SQLAlchemy models here are hand-written and must be kept in step with its schema by hand — nothing checks this. Production: A database user with access to the tables this worker uses. |
DB_PASSWORD | The same database your API owns. The SQLAlchemy models here are hand-written and must be kept in step with its schema by hand — nothing checks this. Production: Its password. |
DB_NAME | The same database your API owns. The SQLAlchemy models here are hand-written and must be kept in step with its schema by hand — nothing checks this. Production: The API's database name. |
REDIS_HOST | The same Redis your API produces jobs to. A mismatch is silent: the worker connects fine and simply never receives anything. Production: Your Redis host; identical on the API and every worker. A worker on a different Redis connects fine and never receives a job. See Redis. |
REDIS_PORT | The same Redis your API produces jobs to. A mismatch is silent: the worker connects fine and simply never receives anything. Production: Your Redis port (6379). |
REDIS_USER | The same Redis your API produces jobs to. A mismatch is silent: the worker connects fine and simply never receives anything. Production: An ACL user, if your Redis uses them. |
REDIS_PASSWORD | The same Redis your API produces jobs to. A mismatch is silent: the worker connects fine and simply never receives anything. Production: The Redis password. |
OPENOBSERVE_URL | OpenTelemetry → OpenObserve: traces, logs and metrics. Leave empty and telemetry stays off. Per project: OPENOBSERVE_ORG is the organization identifier, OPENOBSERVE_TOKEN its ingestion token (IAM → Ingestion Tokens). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead. Production: Your OpenObserve instance. Telemetry is on only when the URL, org and token are all set. See OpenObserve. |
OPENOBSERVE_ORG | OpenTelemetry → OpenObserve: traces, logs and metrics. Leave empty and telemetry stays off. Per project: OPENOBSERVE_ORG is the organization identifier, OPENOBSERVE_TOKEN its ingestion token (IAM → Ingestion Tokens). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead. Production: The project's organization identifier. Where to get it: OpenObserve → organization settings (or the org segment of its URLs). |
OPENOBSERVE_TOKEN | OpenTelemetry → OpenObserve: traces, logs and metrics. Leave empty and telemetry stays off. Per project: OPENOBSERVE_ORG is the organization identifier, OPENOBSERVE_TOKEN its ingestion token (IAM → Ingestion Tokens). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead. Production: The organization's ingestion token ( Where to get it: OpenObserve → IAM → Ingestion Tokens. Write-only, but secret: never use it in a browser app (front ends use a RUM token). |
OTEL_SERVICE_NAME | OpenTelemetry → OpenObserve: traces, logs and metrics. Leave empty and telemetry stays off. Per project: OPENOBSERVE_ORG is the organization identifier, OPENOBSERVE_TOKEN its ingestion token (IAM → Ingestion Tokens). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead. Production: A distinct name per service: |
TEMPORAL_ADDRESS | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. Production: Your Temporal frontend, e.g. |
TEMPORAL_NAMESPACE | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. Production: The project's namespace, the same on the API and its workers. |
TEMPORAL_TASK_QUEUE | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. The queue this worker polls. Its own, not the Node worker's: a workflow task handed to a worker that doesn't know the type fails and retries. Start Python workflows on this queue. Production: This worker's own queue ( |
TEMPORAL_TLS_CA | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. The queue this worker polls. Its own, not the Node worker's: a workflow task handed to a worker that doesn't know the type fails and retries. Start Python workflows on this queue. Production: The CA that signed the server's certificate, as PEM; empty if it's publicly trusted. Escaped\n are accepted, so it fits on one line. |
TEMPORAL_TLS_CERT | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. The queue this worker polls. Its own, not the Node worker's: a workflow task handed to a worker that doesn't know the type fails and retries. Start Python workflows on this queue. Production: The project's client certificate, as PEM. Where to get it: Issued by whoever runs your Temporal (the gateway's CA). Set it together withTEMPORAL_TLS_KEY, or startup fails. |
TEMPORAL_TLS_KEY | Temporal: this process also runs the workflows in temporal/. Locally, the API's dev server (its compose.yml; UI on http://localhost:8233), no TLS. In production, the server address, the project's namespace and its mTLS client certificate (plus the CA that signed the server's), as PEM. Escaped \n are accepted, so each fits on one line. The queue this worker polls. Its own, not the Node worker's: a workflow task handed to a worker that doesn't know the type fails and retries. Start Python workflows on this queue. Production: The client certificate's private key, as PEM. A secret: keep it in your secret store. |
Not in .env.example
Section titled “Not in .env.example”| Variable | Used by | Effect |
|---|---|---|
APP_ENV |
telemetry | Sets deployment.environment.name (default development) |
OPENOBSERVE_STREAM |
telemetry | Stream name; defaults to OTEL_SERVICE_NAME |
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS |
telemetry | Any OTLP backend instead of OpenObserve; takes precedence |
OTEL_SDK_DISABLED=true |
telemetry | Turns telemetry off |