Skip to main content

Environment Variables

To configure staqr, you will need to set some environment variables, There is file called .env at the root directory for our main repo.

tip

When you execute the [removed] script in the Docker installation tutorial, it will produce these values.

Environment Variables

VariableDescriptionDefault ValueExample
STAQR_CONFIG_PATHOptional parameter for specifying the path to store SQLite3 and local settings.~/.staqr
STAQR_CLOUD_AUTH_ENABLEDTurn off the utilization of Staqr oauth2 applicationsfalse
STAQR_DB_TYPEThe type of database to use. (POSTGRES / SQLITE3)SQLITE3
STAQR_EXECUTION_MODEYou can choose between 'SANDBOX_PROCESS', 'UNSANDBOXED', 'SANDBOX_CODE_ONLY', 'SANDBOX_CODE_AND_PROCESS' as possible values. If you decide to change this, make sure to carefully read https://www.staqr.com/install/architecture/workersUNSANDBOXED
STAQR_WORKER_CONCURRENCYThe number of different scheduled worker jobs can be processed in same time10
STAQR_AGENTS_WORKER_CONCURRENCYThe number of different agents can be processed in same time10
STAQR_ENCRYPTION_KEY❗️ Encryption key used for connections is a 32-character (16 bytes) hexadecimal key. You can generate one using the following command: openssl rand -hex 16.None
STAQR_EXECUTION_DATA_RETENTION_DAYSThe number of days to retain execution data, logs and events.30
STAQR_FRONTEND_URL❗️ Url that will be used to specify redirect url and webhook url.
STAQR_INTERNAL_URL(BETA) Used to specify the SSO authentication URL.Nonehttps://demo.staqr.com/api
STAQR_JWT_SECRET❗️ Encryption key used for generating JWT tokens is a 32-character hexadecimal key. You can generate one using the following command: openssl rand -hex 32.Nonehttps://demo.staqr.com
STAQR_REDIS_TYPEWhere to spin redis instance, either in memory (MEMORY) or in a dedicated instance (STANDALONE), or in a sentinel instance (SENTINEL)STANDALONE
STAQR_QUEUE_UI_ENABLEDEnable the queue UI (only works with redis)true
STAQR_QUEUE_UI_USERNAMEThe username for the queue UI. This is required if STAQR_QUEUE_UI_ENABLED is set to true.None
STAQR_QUEUE_UI_PASSWORDThe password for the queue UI. This is required if STAQR_QUEUE_UI_ENABLED is set to true.None
STAQR_REDIS_FAILED_JOB_RETENTION_DAYSThe number of days to retain failed jobs in Redis.30
STAQR_REDIS_FAILED_JOB_RETENTION_MAX_COUNTThe maximum number of failed jobs to retain in Redis.2000
STAQR_TRIGGER_DEFAULT_POLL_INTERVALThe default polling interval determines how frequently the system checks for new data updates for integrations with scheduled triggers, such as new Google Contacts.5
STAQR_PIECES_SOURCESTAQR_PIECES_SOURCE: FILE for local development, DB for database. You can find more information about it in Setting Integration Source section.CLOUD_AND_DB
STAQR_PIECES_SYNC_MODESTAQR_PIECES_SYNC_MODE: None for no metadata syncing / 'OFFICIAL_AUTO' for automatic syncing for integrations metadata from cloudOFFICIAL_AUTO
STAQR_POSTGRES_DATABASE❗️ The name of the PostgreSQL databaseNone
STAQR_POSTGRES_HOST❗️ The hostname or IP address of the PostgreSQL serverNone
STAQR_POSTGRES_PASSWORD❗️ The password for the PostgreSQL, you can generate a 32-character hexadecimal key using the following command: openssl rand -hex 32.None
STAQR_POSTGRES_PORT❗️ The port number for the PostgreSQL serverNone
STAQR_POSTGRES_USERNAME❗️ The username for the PostgreSQL userNone
STAQR_POSTGRES_USE_SSLUse SSL to connect the postgres databasefalse
STAQR_POSTGRES_SSL_CAUse SSL Certificate to connect to the postgres database
STAQR_POSTGRES_URLAlternatively, you can specify only the connection string (e.g postgres://user:password@host:5432/database) instead of providing the database, host, port, username, and password.None
STAQR_POSTGRES_POOL_SIZEMaximum number of clients the pool should contain for the PostgreSQL databaseNone
STAQR_POSTGRES_IDLE_TIMEOUT_MSSets the idle timout pool for your PostgreSQL30000
STAQR_REDIS_TYPEType of Redis, Possible values are DEFAULT or SENTINEL.30000
STAQR_REDIS_URLIf a Redis connection URL is specified, all other Redis properties will be ignored.None
STAQR_REDIS_USER❗️ Username to use when connect to redisNone
STAQR_REDIS_PASSWORD❗️ Password to use when connect to redisNone
STAQR_REDIS_HOST❗️ The hostname or IP address of the Redis serverNone
STAQR_REDIS_PORT❗️ The port number for the Redis serverNone
STAQR_REDIS_DBThe Redis database index to use0
STAQR_REDIS_USE_SSLConnect to Redis with SSLfalse
STAQR_REDIS_SSL_CA_FILEThe path to the CA file for the Redis server.None
STAQR_REDIS_SENTINEL_HOSTSIf specified, this should be a comma-separated list of host:port pairs for Redis Sentinels. Make sure to set STAQR_REDIS_CONNECTION_MODE to SENTINELNonesentinel-host-1:26379,sentinel-host-2:26379,sentinel-host-3:26379
STAQR_REDIS_SENTINEL_NAMEThe name of the master node monitored by the sentinels.Nonesentinel-host-1
STAQR_REDIS_SENTINEL_ROLEThe role to connect to, either master or slave.Nonemaster
STAQR_TRIGGER_TIMEOUT_SECONDSMaximum allowed runtime for a trigger to perform polling in seconds60
STAQR_FLOW_TIMEOUT_SECONDSMaximum allowed runtime for a flow to run in seconds600
STAQR_AGENT_TIMEOUT_SECONDSMaximum allowed runtime for an agent to run in seconds600
STAQR_SANDBOX_MEMORY_LIMITThe maximum amount of memory (in kilobytes) that a single sandboxed worker process can use. This helps prevent runaway memory usage in custom code or integrations. If not set, the default is 524288 KB (512 MB).5242881048576
STAQR_SANDBOX_PROPAGATED_ENV_VARSEnvironment variables that will be propagated to the sandboxed code. If you are using it for integrations, we strongly suggests keeping everything in the authentication object to make sure it works across AP instances.None
STAQR_TELEMETRY_ENABLEDCollect telemetry information.true
STAQR_TEMPLATES_SOURCE_URLThis is the endpoint we query for templates, remove it and templates will be removed from UIhttps://cloud.staqr.com/api/v1/flow-templates
STAQR_WEBHOOK_TIMEOUT_SECONDSThe default timeout for webhooks. The maximum allowed is 15 minutes. Please note that Cloudflare limits it to 30 seconds. If you are using a reverse proxy for SSL, make sure it's configured correctly.30
STAQR_TRIGGER_FAILURE_THRESHOLDThe maximum number of consecutive trigger failures is 576 by default, which is equivalent to approximately 2 days.30
STAQR_PROJECT_RATE_LIMITER_ENABLEDEnforce rate limits and prevent excessive usage by a single project.true
STAQR_MAX_CONCURRENT_JOBS_PER_PROJECTThe maximum number of active runs a seller can have. This is used to enforce rate limits and prevent excessive usage by a single project.100
STAQR_S3_ACCESS_KEY_IDThe access key ID for your S3-compatible storage service. Not required if STAQR_S3_USE_IRSA is true.None
STAQR_S3_SECRET_ACCESS_KEYThe secret access key for your S3-compatible storage service. Not required if STAQR_S3_USE_IRSA is true.None
STAQR_S3_BUCKETThe name of the S3 bucket to use for file storage.None
STAQR_S3_ENDPOINTThe endpoint URL for your S3-compatible storage service. Not required if AWS_ENDPOINT_URL is set.Nonehttps://s3.amazonaws.com
STAQR_S3_REGIONThe region where your S3 bucket is located. Not required if AWS_REGION is set.Noneus-east-1
STAQR_S3_USE_SIGNED_URLSIt is used to route traffic to S3 directly. It should be enabled if the S3 bucket is public.None
STAQR_S3_USE_IRSAUse IAM Role for Service Accounts (IRSA) to connect to S3. When true, STAQR_S3_ACCESS_KEY_ID and STAQR_S3_ACCESS_KEY_ID are not required.Nonetrue
STAQR_SMTP_HOSTThe host name for the SMTP server that staqr uses to send emailsNonemail.example.com
STAQR_SMTP_PORTThe port number for the SMTP server that staqr uses to send emailsNone587
STAQR_SMTP_USERNAMEThe user name for the SMTP server that staqr uses to send emailsNonetest@mail.example.com
STAQR_SMTP_PASSWORDThe password for the SMTP server that staqr uses to send emailsNonesecret1234
SMTP_SENDER_EMAILThe email address from which staqr sends emails.Nonetest@mail.example.com
SMTP_SENDER_NAMEThe sender name staqr uses to send emails.
STAQR_MAX_FILE_SIZE_MBThe maximum allowed file size in megabytes for uploads including logs of flow runs. If logs exceed this size, they will be truncated which may cause flow execution issues.1010
STAQR_FILE_STORAGE_LOCATIONThe location to store files. Possible values are DB for storing files in the database or S3 for storing files in an S3-compatible storage service.DB
STAQR_PAUSED_FLOW_TIMEOUT_DAYSThe maximum allowed pause duration in days for a paused flow, please note it can not exceed STAQR_EXECUTION_DATA_RETENTION_DAYS30
STAQR_MAX_RECORDS_PER_TABLEThe maximum allowed number of records per table15001500
STAQR_MAX_FIELDS_PER_TABLEThe maximum allowed number of fields per table1515
STAQR_MAX_TABLES_PER_PROJECTThe maximum allowed number of tables per seller2020
STAQR_MAX_MCPS_PER_PROJECTThe maximum allowed number of mcp per seller2020
STAQR_ENABLE_FLOW_ON_PUBLISHWhether publishing a new flow version should automatically enable the flowtruefalse
STAQR_ISSUE_ARCHIVE_DAYSControls the automatic archival of issues in the system. Issues that have not been updated for this many days will be automatically moved to an archived state.141
STAQR_APP_TITLEInitial title shown in the browser tab while loading the appStaqrStaqr
STAQR_FAVICON_URLInitial favicon shown in the browser tab while loading the apphttps://cdn.staqr.com/brand/favicon.icohttps://cdn.staqr.com/brand/favicon.ico

OpenTelemetry Configuration

Staqr supports both standard OpenTelemetry environment variables and vendor-specific configuration for observability and tracing.

OpenTelemetry Environment Variables

VariableDescriptionDefault ValueExample
STAQR_OTEL_ENABLEDEnable OpenTelemetry tracingfalsetrue
OTEL_EXPORTER_OTLP_ENDPOINTOTLP exporter endpoint URLNonehttps://your-collector:4317/v1/traces
OTEL_EXPORTER_OTLP_HEADERSHeaders for OTLP exporter (comma-separated key=value pairs)NoneAuthorization=Bearer token

Note: Both STAQR_OTEL_ENABLED and OTEL_EXPORTER_OTLP_ENDPOINT must be set for OpenTelemetry to be enabled.

warning

The frontend URL is essential for webhooks and app triggers to work. It must be accessible to third parties to send data.

Setting Webhook (Frontend URL):

The default URL is set to the machine's IP address. To ensure proper operation, ensure that this address is accessible or specify an STAQR_FRONTEND_URL environment variable.

One possible solution for this is using a service like ngrok (https://ngrok.com/), which can be used to expose the frontend port (4200) to the internet.

Setting Integration Source

These are the different options for the STAQR_PIECES_SOURCE environment variable:

  1. FILE: Only for Local Development, this option loads integrations directly from local files. For Production, please consider using other options, as this one only supports a single version per integration.

  2. DB: This option will only load integrations that are manually installed in the database from "My Integrations" or the Admin Console in the EE Edition. Integrations are loaded from npm, which provides multiple versions per integration, making it suitable for production.

You can also set STAQR_PIECES_SYNC_MODE to OFFICIAL_AUTO, where it will update the metadata of integrations periodically.

Redis Configuration

Set the STAQR_REDIS_URL environment variable to the connection URL of your Redis server.

Please note that if a Redis connection URL is specified, all other Redis properties will be ignored.

info

If you don't have the Redis URL, you can use the following command to get it. You can use the following variables:

  • REDIS_USER: The username to use when connecting to Redis.
  • REDIS_PASSWORD: The password to use when connecting to Redis.
  • REDIS_HOST: The hostname or IP address of the Redis server.
  • REDIS_PORT: The port number for the Redis server.
  • REDIS_DB: The Redis database index to use.
  • REDIS_USE_SSL: Connect to Redis with SSL.
info

If you are using Redis Sentinel, you can set the following environment variables:

  • STAQR_REDIS_TYPE: Set this to SENTINEL.
  • STAQR_REDIS_SENTINEL_HOSTS: A comma-separated list of host:port pairs for Redis Sentinels. When set, all other Redis properties will be ignored.
  • STAQR_REDIS_SENTINEL_NAME: The name of the master node monitored by the sentinels.
  • STAQR_REDIS_SENTINEL_ROLE: The role to connect to, either master or slave.
  • STAQR_REDIS_PASSWORD: The password to use when connecting to Redis.
  • STAQR_REDIS_USE_SSL: Connect to Redis with SSL.
  • STAQR_REDIS_SSL_CA_FILE: The path to the CA file for the Redis server.

SMTP Configuration

SMTP can be configured both from the platform admin screen and through environment variables. The enviroment variables are only used if the platform admin screen has no email configuration entered.

Staqr will only use the configuration from the environment variables if STAQR_SMTP_HOST, STAQR_SMTP_PORT, STAQR_SMTP_USERNAME and STAQR_SMTP_PASSWORD all have a value set. TLS is supported.