# How to Configure Macro Inc. for a Specific Use Case: A Developer’s Guide

> Learn how to configure Macro Inc. for your specific use case. This developer's guide covers environment variables, Docker services, and block-specific settings for the macro-inc/macro repository.

- Repository: [Macro/macro](https://github.com/macro-inc/macro)
- Tags: how-to-guide
- Published: 2026-08-20

---

**Configure Macro Inc. by setting environment variables through the `macro_env_var` crate, starting the required Docker-based services with `just` commands, and tuning block-specific settings via each service’s configuration flags.**

Macro Inc. is an all-in-one workspace built as a Rust-based microservices architecture that unifies email, chat, docs, tasks, agents, and CRM into a single bidirectional graph. Because every block shares the same backend, you can configure Macro Inc. for virtually any workflow by exposing the right environment variables and enabling the specific services you need. The repository at `macro-inc/macro` contains over 80 crates, each representing a logical service that you can selectively enable and customize.

## Step 1: Set Up Environment Variables

Macro Inc. expects all secrets to be loaded through the **`macro_env_var`** crate rather than the standard `std::env::var` function. This abstraction ensures consistent secret management across development and production environments.

For local development, generate a `.env` file by running the setup script:

```bash
just setup_test_envs

```

In production deployments, the system pulls configuration from **Doppler** rather than local files. The [`infra/README.md`](https://github.com/macro-inc/macro/blob/main/infra/README.md) file in the repository root details the exact mapping between Doppler configurations and service startup behavior.

Critical variables common to all configurations include database connection strings, Redis URLs, and OpenSearch endpoints. All services read these values at startup, meaning any change requires a service restart via Docker or `just restart <service>`.

## Step 2: Start the Supporting Services

The Macro workspace contains more than 80 crates, with each logical block implemented as a separate service such as `document_storage_service`, `email_service`, `sync-service`, and `agents`. To configure Macro Inc. for your use case, you must selectively spin up the infrastructure these services depend on.

Use the **`just`** command aliases to orchestrate the Docker-based backend:

```bash

# Build all services

just build

# Run the test suite

just test

# Start the full stack without Doppler (local development)

just stack up --no-doppler

```

This command sequence launches Postgres, Redis, OpenSearch, and any Lambda-style services defined in the `infra/` directory. The [`docs/RUNNING_LOCALLY.md`](https://github.com/macro-inc/macro/blob/main/docs/RUNNING_LOCALLY.md) file provides the exact sequence of `just` commands required to bring the full graph online.

## Step 3: Configure Target Blocks

Once the infrastructure is running, enable and tune the specific blocks your workflow requires. Each service maintains its own [`README.md`](https://github.com/macro-inc/macro/blob/main/README.md) with configuration flags.

### Email Configuration

Enable multi-account support by providing a JSON list of Google OAuth client IDs:

```bash
EMAIL_OAUTH_CLIENTS='["client-id-1", "client-id-2"]'

```

See [`services/email_service/README.md`](https://github.com/macro-inc/macro/blob/main/services/email_service/README.md) for the full OAuth2 flow configuration.

### Tasks Configuration

Set the default project for new task creation:

```bash
TASK_DEFAULT_PROJECT=default-project-uuid

```

The task service reads this variable at startup to determine where unassigned tasks are created. Additional deduplication logic is documented in [`crates/task_dedup/README.md`](https://github.com/macro-inc/macro/blob/main/crates/task_dedup/README.md).

### Agents Configuration

Toggle specific agent capabilities using the **`AGENT_ENABLE_*`** flag pattern:

```bash
AGENT_ENABLE_EMAIL_SUMMARY=true
AGENT_ENABLE_CRM_AUTOFILL=true

```

The agent runtime protocol is defined in [`crates/agent_runtime_protocol/Cargo.toml`](https://github.com/macro-inc/macro/blob/main/crates/agent_runtime_protocol/Cargo.toml), which governs how agents interact with the Macro graph via the bidirectional `@link` system.

## Example: Configuring a Sales Automation Workflow

Consider a use case where every incoming sales email automatically creates a CRM deal, links it to a task, and notifies a channel. Configure Macro Inc. for this workflow by setting the following environment variables:

```bash

# .env file

EMAIL_WHITELIST=sales@company.com
CRM_DEFAULT_PIPELINE=sales-pipeline-id
TASK_AUTO_CREATE=true
NOTIFY_CHANNEL_ID=deals-alerts

```

Then start the required services:

```bash
just setup_test_envs
just stack up --no-doppler

```

Verify the configuration by opening any email in the whitelisted account, clicking **Create task**, and confirming that the `@link` to the CRM record appears in the task details. The bidirectional linking system automatically propagates changes across the graph according to the schema conventions defined in [`crates/complete_graph/AGENTS.md`](https://github.com/macro-inc/macro/blob/main/crates/complete_graph/AGENTS.md).

## Critical Configuration Files

Understanding these specific files is essential when you configure Macro Inc. for custom workflows:

- **[`README.md`](https://github.com/macro-inc/macro/blob/main/README.md)** – High-level product overview and the complete block matrix showing how services interact.
- **[`docs/RUNNING_LOCALLY.md`](https://github.com/macro-inc/macro/blob/main/docs/RUNNING_LOCALLY.md)** – Step-by-step instructions for launching the full stack locally using `just` commands.
- **[`infra/README.md`](https://github.com/macro-inc/macro/blob/main/infra/README.md)** – Docker and Doppler infrastructure details, including how environment variables map to container orchestration.
- **[`crates/complete_graph/AGENTS.md`](https://github.com/macro-inc/macro/blob/main/crates/complete_graph/AGENTS.md)** – Schema conventions that dictate how `id` fields and the `GraphqlUser` root shape affect caching; crucial when adding new entity types.
- **[`crates/client/cache-core/build.rs`](https://github.com/macro-inc/macro/blob/main/crates/client/cache-core/build.rs)** – Cache-key generation logic that enforces the `id: ID!` contract for all graph entities.
- **[`services/email_service/README.md`](https://github.com/macro-inc/macro/blob/main/services/email_service/README.md)**, **[`services/notification_service/README.md`](https://github.com/macro-inc/macro/blob/main/services/notification_service/README.md)**, and **[`services/contacts_service/README.md`](https://github.com/macro-inc/macro/blob/main/services/contacts_service/README.md)** – Service-specific configuration flags, feature toggles, and runtime behavior.

## Summary

- **Use the `macro_env_var` crate** for all environment variable access, loading secrets from `.env` in development (via `just setup_test_envs`) and Doppler in production.
- **Start infrastructure** using `just stack up --no-doppler` to launch Postgres, Redis, OpenSearch, and the 80+ Rust crate services required for your workflow.
- **Enable specific blocks** by setting their configuration flags (e.g., `EMAIL_OAUTH_CLIENTS`, `CRM_DEFAULT_PIPELINE`, `AGENT_ENABLE_*`) in environment variables.
- **Leverage the `@link` system** to automatically propagate changes across email, docs, tasks, CRM, and agents once services are running.
- **Restart services** after any configuration change, as all settings are read at startup.

## Frequently Asked Questions

### How do I add a new environment variable to the Macro Inc. configuration?

Define the variable in your `.env` file (for local development) or Doppler (for production), then access it via the `macro_env_var` crate rather than `std::env::var`. Ensure the variable is documented in the relevant service’s [`README.md`](https://github.com/macro-inc/macro/blob/main/README.md) and restart the service using `just restart <service>` or `docker restart` for changes to take effect.

### What is the difference between `just setup_test_envs` and production Doppler configuration?

The `just setup_test_envs` command generates a local `.env` file with test-safe defaults suitable for development on the `macro-inc/macro` repository. Production deployments pull the same variable names from Doppler’s secret management infrastructure, as detailed in [`infra/README.md`](https://github.com/macro-inc/macro/blob/main/infra/README.md), ensuring secrets never exist in plaintext files on production servers.

### How does the bidirectional `@link` system affect service configuration?

The `@link` system requires that all entities expose an `id: ID!` field according to the schema conventions in [`crates/complete_graph/AGENTS.md`](https://github.com/macro-inc/macro/blob/main/crates/complete_graph/AGENTS.md). When you configure Macro Inc. for a new use case, ensure your custom entities comply with the `id` field requirements enforced by [`crates/client/cache-core/build.rs`](https://github.com/macro-inc/macro/blob/main/crates/client/cache-core/build.rs), or caching will fail across the graph.

### Can I run individual services without starting the entire 80+ crate stack?

Yes. Use `just build` to compile specific crates, then run individual binaries (e.g., `cargo run -p email_service`) while ensuring the backing infrastructure (Postgres, Redis) is running via Docker. The [`docs/RUNNING_LOCALLY.md`](https://github.com/macro-inc/macro/blob/main/docs/RUNNING_LOCALLY.md) file provides patterns for selective service startup when you only need specific blocks like email or agents.