# CLI Source: https://docs.major.build/build/cli Build Major apps, agents, skills, and workflows from your own machine and IDE with the Major CLI. The `major` CLI lets you work on Major from your own machine. You get a local folder for each app, agent, skill, or workflow, edit it with any editor or coding assistant, and sync it back to Major when you are ready. * **Apps** are git repositories. You run them locally with your connectors wired in, then deploy. * **Agents, skills, and workflows** are small file bundles. You pull them, edit, validate, push a new version, and publish. For every command and flag, see the [CLI reference](/reference/cli/overview). ## Set up **1. Check prerequisites** You need macOS or Linux with Git installed. To work on apps, you also need Node.js 22.12 or later and pnpm. **2. Install the CLI** ```bash curl theme={null} curl -fsSL https://install.major.build | bash ``` ```bash Homebrew theme={null} brew tap major-technology/tap brew install major-technology/tap/major ``` Confirm with `major --version`. Update later with `major update`. **3. Log in** ```bash theme={null} major user login ``` This opens your browser to authorize the CLI, then asks you to pick a default organization. Check your session with `major user whoami` and your organization with `major org whoami`. Switch organizations with `major org select`. **4. Set your GitHub username (apps only)** App code lives in GitHub. The CLI detects your username from your SSH configuration. If it cannot, set it once: ```bash theme={null} major user gitconfig --username "your-github-username" ``` ## Build an app **1. Create or clone the app** Create a new app with its own GitHub repository. New apps start from the Vite-Hono template (a Vite frontend and a Hono backend): ```bash theme={null} major app create ``` Or clone an app that already exists in your organization: ```bash theme={null} major app clone ``` Both commands set up the local folder, generate `.env`, and generate clients for the app's resources. **2. Run it locally** From the app folder: ```bash theme={null} major app start ``` This refreshes `.env`, syncs theme files, runs `pnpm install`, and starts `pnpm dev`. Your local app reaches connectors through Major, so you do not need database credentials on your machine. **3. Attach connectors** See which resources exist and which are attached, then attach the ones you need: ```bash theme={null} major resource list major resource add --id ``` Or pick them interactively with `major resource manage`. The CLI regenerates resource clients for your code. Learn more in [Connectors](/learn/connectors/overview). To switch the environment your app uses, run `major resource env`, then `major app start` again. Manage variables with [`major vars`](/reference/cli/vars). **4. Deploy** Commit, push, and deploy in one step: ```bash theme={null} major app deploy -m "Describe the change" ``` The first deploy asks for a URL slug (or pass `--slug`). The command waits for the deployment and prints the app's URL. If you prefer to commit with git yourself, use `major push` and then `major publish`. See [pull, push, validate, publish](/reference/cli/sync). **5. Check on it** ```bash theme={null} major app info major app logs --since 1h major app errors list ``` Manage who can use the app with `major app configure`, which opens its settings in your browser. > [!TIP] > > An app is an ordinary git repository. Use branches, your IDE, and your usual tools. Only `major push`, `major publish`, and `major app deploy` need you on the default branch. ## Build an agent, skill, or workflow [Agents](/learn/agents/overview), [skills](/learn/skills/overview), and [workflows](/learn/workflows/overview) are versioned file bundles. Each local folder has a `.major/config.json` that links it to its bundle, so the same four commands work for all three. | Kind | Files in the folder | | - | - | | Agent | `agent.jsonc` and `prompt.md` | | Skill | `SKILL.md` at the root, plus any references and scripts | | Workflow | `.jsonc` | **1. Create or clone** > [tab] Agent > > ```bash theme={null} > major agent create support-triage --name "Support triage" > # or > major agent clone --id > ``` > [tab] Skill > > ```bash theme={null} > major skill create invoice-lookup > # or > major skill clone --id > ``` > [tab] Workflow > > ```bash theme={null} > major workflow create nightly-sync > # or > major workflow clone --id > ``` Find IDs with `major agent list`, `major skill list`, or `major workflow list`. Without `--id`, `clone` lets you pick from a list. Then `cd` into the new folder. **2. Pull the latest version** If someone else may have saved changes since you cloned, bring the folder up to date: ```bash theme={null} major pull ``` > [!WARNING] > > `major pull` overwrites the bundle's files with the latest saved version. Push any local edits you want to keep first. **3. Edit** Edit the files in your editor. A skill's name comes from its `SKILL.md` frontmatter, and a workflow's label comes from its definition. **4. Validate** ```bash theme={null} major validate ``` Major checks the files and lists any errors and warnings. Nothing is saved. **5. Push a new version** ```bash theme={null} major push -m "Describe the change" ``` This saves the folder as a new unpublished version. Users keep getting the published version until you publish. **6. Publish** ```bash theme={null} major publish ``` This publishes the latest saved version, so push first. Pass `--yes` to skip the confirmation. For agents, you can then start and follow runs from the terminal: ```bash theme={null} major agent run -p "Summarize yesterday's open tickets" major agent run content ``` See [major agent](/reference/cli/agent) for runs and Slack apps. ## Scripts and CI Pass `--non-interactive` to make any command fail instead of prompting or opening a browser, and supply the values it would have asked for as flags. For example: ```bash theme={null} major agent clone --id --non-interactive major publish --yes --non-interactive ``` Many commands also accept `--json` for machine-readable output. ## Next steps > [card] [CLI reference](/reference/cli/overview) > > Every command and flag. > [card] [Apps](/learn/apps/overview) > > How Major apps work. > [card] [MCP](/build/mcp) > > Connect your coding assistant to Major. > [card] [Platform Agent](/build/platform-agent) > > Build in the browser instead. # MCP Source: https://docs.major.build/build/mcp Build on Major from Claude Code, Codex, ChatGPT, Claude Desktop, Cursor, or any MCP client. The Major MCP server exposes Major itself as [Model Context Protocol](https://modelcontextprotocol.io) tools. Connect an MCP client and your AI assistant can list and create apps, agents, skills, and workflows, start sandboxes and edit their files, query your connectors, run agents and workflows, and deploy - from the client you already use. It gives your client the same capabilities as the [Platform Agent](/build/platform-agent) in the web app. ## Example requests * "List the apps I can edit in Major." * "Create an app that shows open support tickets from our Postgres database, then deploy it." * "Add a status filter to the dashboard in my `ops-dashboard` app." * "Build an agent that summarizes yesterday's Slack messages in #sales." * "Run the `weekly-report` workflow with the input `{ \"region\": \"EMEA\" }`." * "How many customers signed up last week?" ## Connect > [!TIP] > > The recommended way to connect is the **Major plugin**. It configures the MCP server and installs the Major skills in one step. See the [Quickstart](/get-started/quickstart) for install steps for each client. To configure the server by hand, use: | | | | - | - | | **Endpoint** | `https://mcp.major.build/mcp` | | **Transport** | Streamable HTTP | | **Authentication** | OAuth | The first time your client connects, a browser tab opens to Major. Sign in and click **Allow** to grant the client access to your organization. The client then stores the token and connects without prompting again. > [!NOTE] > > The access token is tied to one organization. To work in a different organization, reconnect the server and approve access for that organization. ### Skills in the plugin The plugin also installs skills that teach your assistant how to build on Major. The assistant loads them on demand: | Skill | Use it for | | - | - | | `new-project` | Planning a brand new app: connector setup and the data layer | | `app-builder` | Creating and editing apps in an app sandbox | | `agent-builder` | Creating and configuring agents (`agent.jsonc` and `prompt.md`) | | `skill-builder` | Creating and managing agent skills | | `workflow-builder` | Creating and managing workflows, their nodes, and triggers | | `using-connectors` | Querying connectors and Major platform resources, with per-connector references | | `using-apps` | Calling the API of a deployed app | | `using-authn` | Adding sign-in and identity to an app | | `using-webhooks` | Receiving webhooks in a deployed app | | `using-frontend-data-table` | Building table views in an app's frontend | | `debug-issue` | Investigating errors, failed calls, and broken behavior | The Platform Agent uses the same skills, so your client and the web app build things the same way. ## What it can do | Group | Tools | What they do | | - | - | - | | **Discovery** | `list`, `list_sandboxes` | List the apps, agents, skills, or workflows you can edit (or view, with `include_read_only`). List your running sandboxes. | | **Create** | `create` | Create an app, agent, skill, or workflow and start its sandbox. | | **Sandboxes** | `start_sandbox`, `stop_sandbox` | Start the sandbox for an existing app, agent, skill, or workflow, or release it. | | **Sandbox editing** | `sandbox_read_file`, `sandbox_write_file`, `sandbox_edit_file`, `sandbox_glob`, `sandbox_grep`, `sandbox_bash`, `sandbox_bash_output`, `sandbox_bash_stop`, `sandbox_workspace_status`, `sandbox_restart_preview` | Read, write, and search files, and run shell commands in a sandbox. `sandbox_restart_preview` restarts an app's preview server. | | **App wiring** | `sandbox_add-resource-client`, `sandbox_remove-resource-client`, `sandbox_add-agent-client`, `sandbox_remove-agent-client` | Add or remove a connector or an agent client in an app. | | **Connectors** | `search_resource_tool_catalog`, `execute_resource_tool` | Find a connector tool by describing what you need, then run it against one of your connectors. | | **Connector setup** | `search_connector_types`, `request_resource_setup` | Find connector types and get a prefilled link to set up a new connector. | | **Deployed apps** | `get_app_skill`, `do_get_request`, `do_requests` | Read a deployed app's API guide and call its endpoints. Redirects from the app aren't followed: the call returns the `3xx` status and its `Location` header. | | **Agent logins** | `request_agent_login` | Get a link where someone with edit access to an agent saves a website login for it, so the agent's [browser](/learn/agents/browser) can sign in to that site. | | **Running** | `run_agent`, `run_workflow` | Start a run of an agent's published version, or run the latest saved draft of a workflow. | | **Environments** | `get_environment`, `set_environment` | See or switch the [environment](/learn/apps/environments#your-environment-choice) your connector calls and app previews use. Only shown in organizations with more than one environment. | | **Data and config** | `setup_managed_database`, `run_migration`, `set_app_env_variables` | Create an app's [managed database](/learn/apps/managed-databases), run SQL migrations on it, and get a link to set an app's [environment variables](/learn/apps/environment-variables). | | **Access** | `list_subjects`, `list_access`, `set_access`, `list_subject_access` | Find users and groups, see who has access to an app, agent, skill, workflow, or connector, and grant, change, or remove a role on it. See [Managing access](#managing-access). | Tools that need secrets or credentials, such as `request_resource_setup` and `set_app_env_variables`, never take them from your assistant. They return a link that you open in Major to enter the values yourself. ## How it works ### Sandboxes Apps, agents, skills, and workflows are all edited on a remote sandbox. Your assistant finds what to edit with `list`, starts its sandbox with `start_sandbox` (or `create` for something new), and then edits through the `sandbox_*` tools. Every sandbox call names its target: an app's slug, or an agent, skill, or workflow id. Several sandboxes can run at once. You can watch every sandbox your client starts at [app.major.build/sandboxes](https://app.major.build/sandboxes), with one tab per sandbox, including an app's live preview. A sandbox is held by one person at a time. If someone else is editing the same item, `start_sandbox` reports that it is locked. ### Saving, publishing, and deploying Inside a sandbox, `sandbox_bash` runs the Major CLI in the workspace root: | Command | Agent, skill, or workflow | App | | - | - | - | | `major pull` | Pull the saved bundle | `git pull` | | `major push` | Save a new version | `git push` | | `major validate` | Validate the bundle | Run lint | | `major publish` | Publish the latest saved version | Deploy the pushed commit | An app's first deploy needs `major publish --slug ` to choose its URL. See the [CLI](/build/cli) for the full command set. ### Connectors Your assistant does not load a separate tool for every connector. It describes what it needs to `search_resource_tool_catalog` (for example, "read-only SQL against Postgres"), gets back matching tools with their input schemas, and runs one with `execute_resource_tool`. See [Connectors](/learn/connectors/overview). ### Managing access Ask your assistant who can reach something, or to share it, for example "Who has access to the ops dashboard?" or "Make the Support group an Editor on the triage agent." | Tool | Who can use it | What it does | | - | - | - | | `list_subjects` | Builders and admins | Find users or groups by name or email, or list a group's members. | | `list_access` | Builders and admins | List the users and groups that hold a role on one app, agent, skill, workflow, or connector. | | `set_access` | Builders and admins | Grant, change, or remove a user's or group's role on one object. | | `list_subject_access` | Organization admins | List everything one user or group can reach, directly and through groups. | `list_access` and `set_access` only work on objects whose access you can manage, meaning you're their Admin or an organization admin. They follow the same rules as the share dialogs in the web app. A role must match the object type. Members and external users can only get User roles. An object always keeps at least one Admin unless an organization admin removes it. Removing a user's direct role doesn't remove access they have through a group. The [Platform Agent](/build/platform-agent) has the same tools. There, `set_access` asks for your approval before it runs. ## What `execute_resource_tool` and `sandbox_bash` can reach These two tools are broad, so here is exactly what each one can touch. ### `execute_resource_tool` `execute_resource_tool` runs one tool from your organization's connector catalog. It reaches only connectors that an admin has configured in Major, and of those, only the ones your roles let you use. It cannot reach any system that isn't set up as a connector. | Connector type | Examples | Write actions it can take | | - | - | - | | **Databases** | Postgres, MySQL, SQL Server, Snowflake, BigQuery, ClickHouse, DynamoDB | SQL that inserts, updates, or deletes rows or changes the schema | | **Internal APIs** | Your organization's REST and GraphQL APIs | `POST`, `PUT`, `PATCH`, and `DELETE` requests, and GraphQL mutations | | **SaaS connectors** | HubSpot, Salesforce, Gmail, Slack, Google Drive, Notion, GitHub | Creating, updating, sending, or deleting records, such as sending an email or a Slack message | | **Storage** | S3 and managed file storage | Uploading, overwriting, and deleting files | Whether a write succeeds also depends on the connector's own credentials. A database connector set up with a read-only user can only read. See the [connector reference](/reference/connectors) for every connector type. For PostgreSQL, MySQL, SQL Server, and ClickHouse, a query's result returned to the AI is capped at 1 MB. A larger result fails with `result exceeds 1 MB; add a LIMIT or select fewer columns`. Add a `LIMIT`, select fewer columns, or page through the rows. Queries that apps run through the [resource client](/learn/connectors/resource-client) aren't affected by this cap. ### `sandbox_bash` `sandbox_bash` runs shell commands inside the isolated edit sandbox of one app, agent, skill, or workflow. The sandbox is a dedicated container that holds only that item's workspace. * **Network scope:** public internet only. Major's private network and the cloud metadata endpoint are blocked. * **Connectors:** reachable only through Major's API, using the same access your roles give you. The sandbox holds no connector credentials. > [!WARNING] > > Running `major publish` from `sandbox_bash` ships to production. For an app, it deploys the pushed commit to the app's live URL. For an agent, skill, or workflow, it makes the latest saved version the live one. Your client runs it like any other shell command, so use your client's tool approval settings if you want to confirm each `sandbox_bash` call. ## Permissions The MCP server acts as you: * **Scoped to your organization.** Every call runs in the organization you approved when you connected. * **Scoped to your roles.** `list` returns only what you can access, and each tool checks your access to the item it touches. Creating things, starting sandboxes, running agents and workflows, and connector setup require permission to build in the organization. Members without it see only the connector, deployed-app, and listing tools. See [Members & roles](/settings/members-and-roles). * **Approvals happen in your client.** Your personal [tool permissions](/settings/tool-permissions) apply to Platform Agent chats in the web app, not to MCP clients. Use your client's own tool approval settings to control what runs without asking. ## Next steps > [card] [Quickstart](/get-started/quickstart) > > Install the Major plugin in your client. > [card] [Platform Agent](/build/platform-agent) > > The same capabilities, built into the web app. > [card] [CLI](/build/cli) > > Build on Major from your own terminal. # Platform Agent Source: https://docs.major.build/build/platform-agent The AI assistant in the Major web app that builds apps, agents, skills, and workflows and answers questions about your data. The Platform Agent is the AI assistant you chat with in the [Major web app](/learn/web-app). Describe what you want and it plans the work, asks for approval where needed, and builds it: apps, agents, skills, and workflows. It can also query your connectors directly to answer questions about your data. ## Example requests * "How many deals did we close last quarter, by region?" * "Build an app that tracks open support tickets from our Postgres database." * "Create an agent that posts a summary of new Salesforce leads to #sales every morning." * "Write a skill that explains how our billing tables fit together." * "Make a workflow that runs the lead-scoring agent whenever a new Attio record is created." * "Add a date filter to the revenue dashboard and deploy it." ## What it can do | Capability | What it does | | - | - | | **Answer data questions** | Queries your [connectors](/learn/connectors/overview) and replies in the chat. For bulk work, such as paging through a full history, it writes and runs a script instead of calling tools one page at a time. | | **Build apps** | Creates and edits full-stack [apps](/learn/apps/overview) in a sandbox with a live preview, then deploys them. | | **Build agents** | Drafts an [agent's](/learn/agents/overview) prompt, attaches the connectors, apps, and skills it needs, and saves and publishes it. | | **Build skills** | Writes [skills](/learn/skills/overview) that agents load on demand. | | **Build workflows** | Builds [workflows](/learn/workflows/overview) and their [triggers](/learn/triggers/overview), and runs them to test. | | **Use what exists** | Calls your deployed apps' APIs, runs agents and workflows, and opens a deployed app in a side panel. | | **Show results visually** | Answers with a small interactive UI in the chat, such as stat tiles, a chart, or a table you can filter, when that's clearer than text. The UI holds its data inline and never calls your systems. In Slack, you get the text answer and a link to see the UI in Major. | | **Browse the web** | Opens websites in a hosted [browser](/learn/agents/browser) to read, click, type, sign in, and take screenshots, within your organization's [browser controls](/settings/browser-controls). | | **Check activity and clean up** | Reports how much your apps, agents, and workflows were used over the last 90 days (active minutes for an app; runs and failed runs for an agent or workflow), and deletes an app, agent, or workflow when you ask. Deleting needs your approval and the same permission as deleting it in the web app. | | **Set things up** | Asks you to add a connector, sign in to one, or enter an app's environment variables when the work needs it. | ## How it works ### Plans For complex, ambiguous, or long-running requests, the Platform Agent tells you its approach before it starts, or asks a question when there are meaningfully different ways to do the work. ### Questions When the Platform Agent needs a decision from you, it shows a question card with one or more questions and a set of options for each. Some options include a visual preview, such as a layout mockup, so you can compare them. Pick your options and click **Submit answers**. You can also: * **Attach files to an answer** - click **Attach files** under a question, or drop files on the card, to send them with that answer. * **Answer in your own words** - type in the chat composer while the card is open and click **Respond**. Your message is sent as the answer, along with any options you already picked. Questions you didn't pick an option for show as **Answered in chat**. * **Skip the questions** - open the menu next to **Respond** and choose **Skip questions and send** to send your message as a new instruction instead. Once answered, the card shows a summary of each question's answer and attached files, and marks any you skipped. ### Sandboxes Apps, agents, skills, and workflows are each edited on a sandbox attached to the chat. Several can be attached at once, so one conversation can build an app and the agent it calls. A sandbox is held by one person at a time; if someone else is editing the same item, the Platform Agent tells you it is locked. Chats you start from an item's editor are pinned to that item, and its sandbox starts automatically. ### Tool cards Each action the Platform Agent takes appears in the conversation as a tool card, so you can see what it read, queried, edited, or ran. Approvals, questions, and setup requests appear as cards you act on directly. ## Approvals When the Platform Agent wants to use a tool that needs your sign-off, and the chat is in **Manual** approvals or [auto review](#auto-and-manual) hands the call to you, it shows a **Permission request** card with the tool name, the reason, and the arguments it will send. Choose: | Button | Effect | | - | - | | **Approve** | Run this call once. | | **Deny** | Block this call. The Platform Agent is told it was denied. | | **Always approve** | Run this call and save an always-allow rule for this tool in your chats. Offered for connector tools and app endpoints. | By default, read-only connector tools and app `GET` requests run without asking, and tools that write ask first. Actions such as running an agent, running a database migration, or deleting an app, agent, or workflow always ask. Manage your saved rules, or set **always allow**, **ask**, or **always deny** for any tool ahead of time, on the [Tool Permissions](/settings/tool-permissions) page. When you chat with a specific agent, that agent's [tool permissions](/learn/agents/tool-permissions) apply instead of yours. ### Auto and Manual The **Approvals** menu next to the send button sets who decides tool calls that would otherwise ask you: | Option | Behavior | | - | - | | **Auto** (default) | An auto reviewer decides each approval for you, so the Platform Agent can keep working without stopping. Calls it judges risky are denied, and the Platform Agent can then ask you about them. | | **Manual** | You get a **Permission request** card for each call and decide it yourself. | Every chat starts in **Auto**. In Auto, the reviewer looks at the call and the recent conversation and judges whether you would approve it. Calls that move your request forward run. A call is denied if it could leak data in a way you wouldn't expect, has nothing to do with what you're working on, or touches very sensitive data (such as writing to a production database) that you didn't clearly ask for. When a call is denied, the Platform Agent is told to take a safer route or to stop and ask you. Auto mode still sends some things to you: * Questions, connector setup and sign-in requests, and environment variable requests always go to you. * If the review fails or the call is too large to review, you get a **Permission request** card. * After three auto-denied calls in a row in a chat, the next call comes to you. Auto only covers calls that would otherwise ask. Tools you set to **always allow** still run, and tools set to **always deny** stay blocked. Only the person who owns a chat can switch it between Auto and Manual. On a shared edit chat that no one owns, anyone with access can switch it. ## Shell command screening Shell commands the Platform Agent or an agent runs on Major-hosted machines, in its own workspace or in an app sandbox, run without asking. Before each one runs, Major screens it for attempts to attack Major's infrastructure, such as reaching cloud-metadata addresses or internal services, sending the machine's credentials elsewhere, or escaping the container. Ordinary development is never blocked, even when it's destructive to the workspace itself. When a command is blocked, the agent is told so and continues without it. Connector calls get a similar check; see [Call screening](/learn/connectors/overview#call-screening). ## Models Pick a tier - **Smartest**, **Balanced**, or **Fastest** - from the model picker when you start a chat. Each tier maps to the model your organization configured for it. The model is fixed once the chat starts, and a chat with an agent uses that agent's model. Admins choose the model behind each tier in [Settings > Models](/settings/models). ## Conversation files Files the Platform Agent writes in its working directory, such as notes, scripts, and intermediate results, persist for the conversation, so you can pick up where you left off. ## Platform Agent and MCP The Platform Agent uses the same tools and skills as the [Major MCP server](/build/mcp). If you prefer to work in Claude Code, Codex, ChatGPT, Cursor, or another MCP client, connect it to Major and you get the same capabilities there. The main differences: | | Platform Agent | MCP client | | - | - | - | | **Where** | The Major web app | Your own AI client | | **Approvals** | Permission request cards and your [tool permissions](/settings/tool-permissions) | Your client's own tool approval settings | | **Connector and env var setup** | Setup forms open in the chat | You get a link to open in Major | | **Hosted browser** | Available | Not available. The `browser` tool only runs in Major chats and agent runs. | ## Next steps > [card] [Web app](/learn/web-app) > > Find your way around chat, apps, agents, and settings. > [card] [Tool Permissions](/settings/tool-permissions) > > Choose which tools run without asking in your chats. > [card] [MCP](/build/mcp) > > Get the same capabilities in your own AI client. # Quickstart Source: https://docs.major.build/get-started/quickstart Install the Major plugin in your AI client and build your first app. This guide connects your AI client to Major and walks you through building and deploying your first app. > [!TIP] > > Don't use an AI client? Go to [app.major.build](https://app.major.build), sign in, and describe what you want to the [Platform Agent](/build/platform-agent). You can skip to [Step 2](#step-2-build-something). ## Step 1: Install the Major plugin The Major plugin adds the Major MCP server (`https://mcp.major.build/mcp`) and the Major skills to your client. Pick your client: > [tab] Claude Code CLI > > **1. Install the major plugin** > > Run this command in your terminal. The plugin comes from the Anthropic plugin directory, which is built into Claude Code. > > ```bash theme={null} > claude plugin install major@anthropic-plugin-directory > ``` > > **2. Sign in to Major** > > Your browser opens the Major sign-in page. Sign in and accept the access request. > > ```bash theme={null} > claude mcp login plugin:major:major > ``` > > **3. Make sure that the server is connected** > > The "plugin:major:major" server shows the URL `https://mcp.major.build/mcp` and the status "Connected". > > ```bash theme={null} > claude mcp list > ``` > > **4. Test the connection** > > Start Claude Code and ask a question about your Major workspace. > > ```bash theme={null} > claude > ``` > > ```text theme={null} > List my Major apps. > ``` > > > [!NOTE] > > > > You can also install the plugin inside a Claude Code session: `/plugin install major@anthropic-plugin-directory`. > [tab] Codex CLI > > **1. Add the Major plugin marketplace** > > Run this command in your terminal. > > ```bash theme={null} > codex plugin marketplace add major-technology/cli > ``` > > **2. Install the major plugin** > > ```bash theme={null} > codex plugin add major@major > ``` > > **3. Sign in to Major** > > Your browser opens the Major sign-in page. Sign in and accept the access request. > > ```bash theme={null} > codex mcp login major > ``` > > **4. Make sure that the server is connected** > > The "major" server shows the URL `https://mcp.major.build/mcp`. The Auth column no longer shows "Not logged in". > > ```bash theme={null} > codex mcp list > ``` > > **5. Test the connection** > > Start Codex and ask a question about your Major workspace. > > ```bash theme={null} > codex > ``` > > ```text theme={null} > List my Major apps. > ``` > > > [!NOTE] > > > > To get new skill updates later, run `codex plugin marketplace upgrade`. > [tab] ChatGPT Desktop > > **1. Open the Plugins page** > > In the ChatGPT desktop app, click **Plugins** in the side panel. > > ![ChatGPT Plugins page](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/01-plugins-page.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=1251cfad077c3fcbc0972afd7c0b0b32) > > **2. Open the marketplace menu** > > Click **Add** in the top right, then **Add a marketplace**. > > ![Add menu with Add a marketplace](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/02-add-marketplace.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=bdbd70c4333f3385702d2510de7c1713) > > **3. Add the Major marketplace** > > In **Source**, type `major-technology/cli`. Leave **Git ref** and **Sparse paths** empty. Click **Add marketplace**. > > ```text theme={null} > major-technology/cli > ``` > > ![Add plugin marketplace dialog with major-technology/cli](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/03-marketplace-source.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=51e3bd394186a7c9d35a4fbab1516365) > > **4. Find the Major plugin** > > Search for "major", then click the Major plugin: "Build apps and agents on Major". > > ![Plugin search results for major](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/04-search-major.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=1cb3cff3b01b08b03eb6d781f9370132) > > **5. Install the plugin** > > The plugin page shows the Major MCP server and the Major skills. Click **Install plugin**. > > ![Major plugin page with Install plugin](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/05-install-plugin.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=6f8fa091b8438b6c206ac86e47180bee) > > **6. Start using Major** > > The skills are on after the install. Click **Try now**. When ChatGPT asks, sign in to Major and accept the access request. > > ![Major plugin installed, with Try now](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/chatgpt/06-installed.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=473c7f24e8a99876589db32770e85977) > > **7. Test the connection** > > Ask a question about your Major workspace. > > ```text theme={null} > List my Major apps. > ``` > [tab] Claude Desktop > > **1. Install the Major plugin** > > Open the install link, then click **Add**. > > > [card] [Install the Major plugin](https://claude.ai/customize/plugins/id/c2a04a96-04ab-4a5b-98e4-96948a55fdeb%40anthropic-plugin-directory) > > > > Opens the Major plugin in the Anthropic plugin directory. > > **2. Open the plugin's connector** > > On the Major plugin page, open the **Connectors** tab. Next to "major", click **Add for your team**. > > ![Major plugin page, Connectors tab](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/claude-desktop/04-plugin-connectors.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=11639c41f682078e847ac7364ce318a0) > > **3. Confirm for your team** > > Click **Add to your team**. This makes the connector available to everyone in your organization. > > ![Add connector to your team dialog](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/claude-desktop/05-add-to-team.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=fb3f03cdab24479bf1169c5384fa7faa) > > **4. Check the connector URL** > > The form already contains the name "major" and the URL `https://mcp.major.build/mcp`. Click **Continue**. > > ![Add custom connector dialog with the Major URL](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/claude-desktop/06-connector-url.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=9af5f6dcb193b5a9634bed0507003af6) > > **5. Choose the sign-in settings** > > Keep **Sign in now** and **Register automatically**. Both are detected for Major. Click **Add**. > > ![Authentication and OAuth client options](https://mintcdn.com/major-5cc5eebc/ZnVtoWnAFFKxn5jH/images/quickstart/claude-desktop/07-connector-auth.jpg?fit=max\&auto=format\&n=ZnVtoWnAFFKxn5jH\&q=85\&s=69ac33867560152f5200b3fa49b4a613) > > **6. Sign in to Major** > > Claude opens the Major sign-in page. Sign in and accept the access request. > > **7. Test the connection** > > Start a new chat and ask a question about your Major workspace. > > ```text theme={null} > List my Major apps. > ``` ## Step 2: Build something Describe the app you want and name the system its data lives in. For example: ```text theme={null} Build me an app that shows open deals by stage and owner from my HubSpot, with a filter for close date. ``` Here is what happens next: **1. Connector setup** If the connector you named isn't set up yet, you get a setup card (or a link, in an AI client). Open it, connect the account, and the build continues. See [Connectors](/learn/connectors/overview). **2. Sandbox** The agent creates the app and writes the code in a cloud sandbox. It reads the connector's schema and context documents so the queries match your data. **3. Preview** You get a live preview URL of the running app. Ask for changes in plain language and the preview updates. **4. Deploy** When it looks right, ask the agent to deploy. The app gets a production URL that you can share with your team. See [Deploying](/learn/apps/deploying). For more ideas, see [Use cases](/get-started/use-cases). ## Step 3: Next steps > [card] [Use cases](/get-started/use-cases) > > Copyable prompts for apps, agents, and workflows. > [card] [Apps](/learn/apps/overview) > > How apps are built, versioned, and deployed. > [card] [Agents](/learn/agents/overview) > > Build agents that act on your data, in Slack or on a schedule. > [card] [Connectors](/reference/connectors) > > See every connector Major supports. # Use cases Source: https://docs.major.build/get-started/use-cases Example apps, agents, and workflows you can build on Major, with prompts you can copy. Each example below includes a prompt you can paste into the [Platform Agent](/build/platform-agent) or your AI client with the [Major plugin](/get-started/quickstart). Replace the connector names with the tools your company uses. ## Apps ### Sales pipeline dashboard See pipeline by stage, owner, and close date, with deals that have gone quiet flagged for follow-up. ```text theme={null} Build me a pipeline dashboard from my Salesforce. Show open opportunities by stage and owner, total amount per stage, and a table of deals with no activity in the last 14 days. Add filters for owner and close date. ``` ### Customer health dashboard Combine product usage, support tickets, and billing into one health score per account. ```text theme={null} Build a customer health app. For each account, pull ticket volume from Zendesk, subscription status from Stripe, and weekly active users from our PostgreSQL database. Compute a health score, sort accounts from lowest to highest, and let me click into an account to see the details. ``` ### Finance close tracker Track month-end close tasks and reconcile accounting data in one place. ```text theme={null} Build a month-end close tracker. List open invoices and unpaid bills from QuickBooks, and add a checklist of close tasks with an owner, due date, and status that the team can update. Store the checklist in a managed database. ``` ### Internal admin panel Give support or ops a safe way to look up and edit records without direct database access. ```text theme={null} Build an admin panel on our PostgreSQL database. Let me search users by email, view their account and recent orders, and update their plan. Only members of the Support group can make changes, and every edit is logged. ``` ### Marketing performance report Compare ad spend and results across channels. ```text theme={null} Build a marketing dashboard that shows spend, clicks, and conversions per campaign from Meta Ads and LinkedIn Ads, next to sessions and conversions from Google Analytics. Show the last 30 days with a date range picker. ``` ## Agents ### Data analyst in Slack Let your team ask questions about company data in plain language and get answers in Slack. ```text theme={null} Create an agent that answers questions about our data. It can query our Snowflake warehouse and read the table descriptions attached to it. Deploy it as a Slack bot so people can mention it in channels and DMs. ``` ### Call intelligence agent Turn meeting transcripts into structured notes and CRM updates. ```text theme={null} Create an agent that reads new Fireflies transcripts for sales calls, summarizes the call, lists next steps and objections, and adds a note to the matching company in HubSpot. ``` ### Support triage agent Categorize and route incoming tickets. ```text theme={null} Create an agent that reviews new Zendesk tickets, tags each one with a category and priority, looks up the customer's plan in Stripe, and posts urgent tickets from paying customers to the #support-escalations Slack channel. ``` ## Workflows ### New signup triage Research and route every new signup automatically. ```text theme={null} Build a workflow that runs when a new user signs up. Look up their company, score whether they are a good fit, create or update the contact in HubSpot, and post high-fit signups to the #sales Slack channel. ``` ### Daily metrics report Send a summary of key numbers every morning. ```text theme={null} Build a workflow that runs every weekday at 8am. Pull yesterday's signups, revenue, and open support tickets, have an agent write a short summary with notable changes, and post it to the #metrics Slack channel. ``` ### Approval flow for refunds Keep a human in the loop for actions that move money. ```text theme={null} Build a workflow for refund requests. When a request comes in through a webhook, have an agent check the customer's history in Stripe and recommend approve or deny. Send it to a finance approver, and only issue the refund in Stripe after they approve. ``` ### Weekly pipeline review Prepare a pipeline summary before the weekly sales meeting. ```text theme={null} Build a workflow that runs every Monday at 7am. Pull deals that changed stage, slipped their close date, or were created last week from Salesforce, and email a summary to the sales leads with Gmail. ``` ## Learn more > [card] [Apps](/learn/apps/overview) > > How apps work. > [card] [Agents](/learn/agents/overview) > > How agents work. > [card] [Workflows](/learn/workflows/overview) > > How workflows work. > [card] [Connectors](/reference/connectors) > > Every connector you can use. # Introduction Source: https://docs.major.build/index Major is a platform for building apps, agents, skills, and workflows on your company's data. Major is a platform for building apps, agents, skills, and workflows on top of your company's data. You connect your databases, SaaS tools, and APIs once as [connectors](/learn/connectors/overview). Everything you build on Major uses those connectors securely, with access controlled per user. You describe what you want, an AI agent builds it in a sandbox, you preview it, and you deploy it to your team. ## Three ways to build > [card] [Platform](/build/platform-agent) > > Build in the Major web app at [app.major.build](https://app.major.build) by chatting with the Platform Agent. > [card] [MCP](/build/mcp) > > Install the Major plugin in Claude Code, Codex, ChatGPT, or Claude Desktop and build from the AI client you already use. > [card] [CLI](/build/cli) > > Develop apps locally in your own editor with the `major` CLI, then deploy with one command. All three use the same platform. Apps, agents, and connectors you create in one are available in the others. ## Core concepts > [card] [Apps](/learn/apps/overview) > > Full-stack internal tools, such as dashboards and admin panels, deployed with a URL your team can open. > [card] [Agents](/learn/agents/overview) > > Reusable AI agents that act on your data and apps, from the web, in Slack, or on a schedule. > [card] [Skills](/learn/skills/overview) > > Versioned instruction bundles that agents load on demand to handle specific tasks. > [card] [Workflows](/learn/workflows/overview) > > Multi-step automations that chain agents, app calls, branches, and human approvals. > [card] [Triggers](/learn/triggers/overview) > > Start agents and workflows from schedules, connector events, webhooks, or your apps. > [card] [Connectors](/learn/connectors/overview) > > Databases, SaaS tools, and APIs your apps and agents read from and write to. ## No secrets in your code Connectors are configured once in Major. Your code uses generated clients that authenticate through the Major platform, so there are no connection strings, API keys, or `.env` files to manage. The same code works in the sandbox, locally, and in production. ```typescript theme={null} // No connection strings, no API keys, no .env files import { myDatabaseClient } from './clients'; const result = await myDatabaseClient.invoke( 'SELECT * FROM users WHERE id = $1', [userId], 'fetch-user' ); ``` Connectors can use one shared account or let each person sign in with their own account, so every user only reaches the data they are allowed to see. See [Connectors](/learn/connectors/overview) for details. ## Get started > [card] [Quickstart](/get-started/quickstart) > > Install the Major plugin and build your first app in a few minutes. # Access & Permissions Source: https://docs.major.build/learn/agents/access Role-based access control for agents and skills. Agents and skills each have their own role-based access control (RBAC), layered on top of your [organization roles and groups](/settings/members-and-roles). Access is granted per object - you can share a single agent or skill with specific people or groups without giving them access to everything. Don't confuse this with [tool permissions](/learn/agents/tool-permissions): RBAC controls **who can use and edit** an agent or skill; tool permissions control **what an agent itself is allowed to do** once it runs. ## Agents | Role | Can do | | - | - | | **User** | Run the agent and start chats with it. | | **Editor** | Everything a User can, plus edit the definition (prompt, model, connectors, apps, skills, env vars, tool permissions, browser access) and publish, and manage the agent's saved logins. | | **Admin** | Everything an Editor can, plus share the agent with others. | Creating a new agent requires the organization-level **app-creation** permission (Builder role or higher), the same permission used to create apps. ### Sharing The agent's owner or an Admin can grant access to: * **Individuals** - invite users by email. * **Groups** - grant access to an entire team at once (see [Groups](/settings/members-and-roles#groups)). An agent always keeps at least one Admin. Only an organization admin can remove or downgrade its last Admin, whether that's a person or a group. The same rule applies to skills, workflows, apps, and connectors. You can also review and change access by asking the [Platform Agent](/build/platform-agent) or an [MCP client](/build/mcp#managing-access), for example "Who has access to the lead-scoring agent?" or "Give the Sales group User access to it." ### Saved logins Editors and Admins manage an agent's saved website logins. Users can run the agent with them but can't see the passwords. See [An agent's saved logins](/learn/agents/browser#an-agents-saved-logins). ## Skills [Skills](/learn/skills/overview) use the same three roles, so authorship can be separated from use: | Role | Can do | | - | - | | **User** | Read a skill and attach it to agents they can edit. | | **Editor** | Everything a User can, plus modify the skill's content and publish new versions. | | **Admin** | Everything an Editor can, plus share the skill and delete it. | Deleting a skill is blocked while it's still attached to any agent - detach it everywhere first. ## Workflows A [workflow](/learn/workflows/overview) that calls an agent runs as the person who last published the workflow, using their credentials for shared and per-user connectors. See [Triggers](/learn/triggers/overview) for how each trigger type starts a run. ## Shared agents and identity When an agent is shared and someone other than its author runs it, Major distinguishes two identities: * The **author/deployer** - the subject of RBAC checks and the source of shared credentials. * The **runner** - the person who started the run, used for any [per-user OAuth](/learn/connectors/overview#shared-vs-per-user-connections) connectors. This means a shared agent uses shared connectors via the author's credentials, but per-user connectors act as whoever is running it - so each person only ever touches data they're entitled to. ## App triggers For an app to [trigger an agent](/learn/triggers/app-triggers), the agent must be explicitly attached to that app. Attaching requires **edit** access to both the app and the agent - it's a deliberate grant, never inferred from your code. # Browser Source: https://docs.major.build/learn/agents/browser Give Major agents a real web browser to read sites, fill in forms, and sign in. Major can use a web browser to get real work done: read websites, fill in forms, click through pages, and sign in. The browser runs in the cloud, not on your computer, and there's no connector to set up. The browser is available to: * **[Platform Agent](/build/platform-agent)** * **[Agents](/learn/agents/overview)** with **Browser access** turned on Use the browser for sites with no API, one-off lookups, or when you ask for it. ## Example requests * "Find the pricing page for Acme and summarize their plans." * "Look up our company on the state business registry and tell me when the annual report is due." * "Sign in to our supplier portal and download last month's invoice." * "Draft a LinkedIn message to Jane Doe asking for a call next week." ## What it can do The agent drives the browser one action at a time. It can: * Open pages in tabs and move between them. * Read a page's text, or its structure to find buttons, links, and fields. * Click, type, select options, and press keys. * Take screenshots of a page or a single element. * Inspect a page's network requests and console errors. * Sign in with a [saved login](#saved-logins). The agent can't see a live view of the browser, and you don't get a link to one either. Before it sends, posts, buys, submits a form, deletes something, or changes account settings, the agent confirms the exact recipient and content with you, unless you already gave both. Read-only browsing, such as searching or reading, needs no confirmation. ### What it can't do * **Open Major apps.** The browser isn't signed in to Major, so a deployed app only shows its sign-in page. Session preview URLs are blocked. To check an app, the Platform Agent uses the app's preview and logs instead. * **Handle every sign-in check on its own.** For one-time codes or "approve on your phone" prompts, the agent asks you in the chat. * **Go where your [browser controls](/settings/browser-controls) don't allow.** Blocked sites, allowlists, and rules are checked before every action. ## Turning it on for an agent Browser access is off for new agents. Turn it on in the agent editor's **Details** panel under **Browser access**, or set `browserSettings` in `agent.jsonc`: ```jsonc theme={null} "browserSettings": { "enabled": true } ``` The same `browserSettings` object holds the agent's own [browser controls](/settings/browser-controls#agent-controls). ## Browser sessions and sign-ins A browser starts on the first browser action in a chat. Cookies and site sign-ins are kept in a browser profile: * **Your chats** share one profile. A site you signed in to in one chat stays signed in in your other chats. * **An agent's runs** share one profile for that agent, whoever runs it. Your own profile is never used for an agent's runs. ## Saved logins When the browser reaches a sign-in page and has no login saved for that site, the agent shows a **login card** in the chat (or in Slack). The card opens a separate Major page where you enter the fields the site asks for, such as email, username, password, or company ID. Major fills them into the sign-in form. The AI never sees the values, and the agent never asks you to type a password into the chat. On the login page: * **Save this login** is on by default, so Major can sign in to that site again later. Turn it off to use the login just once. * **Decline** tells the agent you won't provide the login. Also good to know: * Logins are saved per exact site, so `www.example.com` and `example.com` need separate logins. * On signup forms, Major generates a password and saves the new login for you. ### Managing your saved logins Open **Account settings > Browser**. Your saved logins are listed under **Saved logins**. You can add one ahead of time, add a label, edit fields, reveal saved values, or delete a login. Deleting a login doesn't sign the browser out of sites it's already signed in to. Only your own chats can use your saved logins. Organization admins can't see or use them, and agents never use them. ### An agent's saved logins An agent with browser access has its own saved logins. They belong to the agent, not to a person, and only that agent's runs fill them in. | Who | Can do | | - | - | | **Editor** or **Admin** of the agent | Add, edit, reveal, and delete the agent's logins under **Saved logins** in the agent's **Browser access** section. Save a login to the agent from a login card. | | **User** of the agent | Run the agent, which can sign in with its saved logins. From a login card, enter a login to use once, without saving it. | When you build an agent with the Platform Agent or an [MCP client](/build/mcp), it can send you a link to save a login to the agent ahead of time. The page shows which site the login is for, and you need edit access to the agent to save it. > [!WARNING] > > Anyone who can run the agent can have it sign in as that account. Only save logins to an agent when that access is fine to share with everyone who can run it. ## Who can use the browser The browser is available to organization **Members**, **Builders**, and **Admins**. App viewers don't get it. In a [custom role](/settings/members-and-roles#custom-roles), it's the **Use the hosted browser** capability. The browser only runs in Major chats and agent runs. An MCP client like Claude Code or Cursor doesn't get the `browser` tool. ## Billing Browser time uses your organization's [credits](/settings/billing#wallet--credits). You can see agent browser spend on the agents dashboard under **Analytics**. ## Next steps > [card] [Browser Controls](/settings/browser-controls) > > Choose which sites the browser can visit and what it can do there. > [card] [Agents](/learn/agents/overview) > > Build an agent and give it browser access. # External Channels Source: https://docs.major.build/learn/agents/external-channels Deploy an agent as its own Slack bot to receive and reply in channels and DMs. External channels connect an agent to Slack under its own bot identity - distinct from the shared Major Slack integration. Users @mention the bot or DM it directly, and the agent responds as itself (for example, "Data Analyst") rather than as the generic Major bot. Replies in the Slack thread continue the same Major session, so context carries forward across the conversation. # Models Source: https://docs.major.build/learn/agents/models Pick the model an agent runs on. Each agent runs on one model. Pick it from the model picker in the agent editor, or set it in `agent.jsonc`. If you don't pick one, the agent uses **Sonnet**. Every chat and run of the agent uses that model. You pick a model family, not a version. Each family always runs the provider's current model, so your agents get new versions without any changes. To see which version a family runs today, hover over it in the model picker. ## Available models **Intelligence** is Major's relative rating from 1 to 5. **Cost** is a relative price band from `$` to `$$$$$`. Actual billing is usage-based. | Model | Provider | Intelligence | Cost | Best for | | - | - | - | - | - | | **Opus** | Anthropic | 5 / 5 | `$$$$$` | Deep, multi-step reasoning. | | **Sonnet** | Anthropic | 4 / 5 | `$$$` | Everyday coding and analysis. | | **Haiku** | Anthropic | 1 / 5 | `$$` | High-volume, lightweight tasks. | | **GPT Sol** | OpenAI | 5 / 5 | `$$$` | Complex coding and agentic work. | | **GPT Luna** | OpenAI | 3 / 5 | `$` | Focused, high-volume tasks. | | **Gemini Argon** | Google | 5 / 5 | `$$$$$` | Complex reasoning, coding, and agentic work. | | **Gemini Flash** | Google | 3 / 5 | `$$` | Sustained agentic and coding tasks. | | **Gemini Flash Lite** | Google | 1 / 5 | `$` | Fast, high-throughput execution. | | **Kimi Pro** | Kimi | 4 / 5 | `$$$` | Long-horizon agentic coding, on Kimi's newest flagship. | | **Kimi** | Kimi | 4 / 5 | `$$$$` | Long-horizon agentic coding. | | **MiniMax** | MiniMax | 3 / 5 | `$` | Long-horizon coding and agentic work. | | **Grok** | xAI | 5 / 5 | `$$$` | Long-running agents, coding, and knowledge work. | Opus, Sonnet, and Haiku are **Recommended by Major**. > [!NOTE] > > The Platform Agent works differently: people choose a tier (Smartest, Balanced, Fastest) and admins pick the model behind each tier. See [Settings > Models](/settings/models). # Overview Source: https://docs.major.build/learn/agents/overview Build reusable AI agents that act on your data and apps. Agents are reusable AI configurations you build once and run on demand. An agent pairs a system prompt with the connectors, apps, skills, and permissions it's allowed to use - so it can autonomously query your data, call your APIs, and take action within boundaries you define. ## What makes up an agent | Field | Description | | - | - | | **System prompt** | The instructions that define the agent's behavior and goals. | | **Model** | The model family the agent runs on, such as Opus, GPT Sol, or Gemini Flash. See [Models](/learn/agents/models). | | **Connectors** | The [resources](/learn/connectors/overview) the agent may query (Postgres, Slack, Salesforce, ...). | | **Applications** | Deployed Major apps the agent may invoke. | | **Skills** | Reusable instruction bundles that extend the agent's abilities. See [Skills](/learn/skills/overview). | | **Tool permissions** | Per-tool allow/ask/deny rules for connectors and app endpoints. See [Tool Permissions](/learn/agents/tool-permissions). | | **Environment variables** | Key/value pairs made available to the agent at runtime, encrypted at rest. | | **Browser access** | Gives the agent a hosted web browser so it can visit websites, click through them, and sign in. Off by default. See [Browser](/learn/agents/browser). | ## How agents are defined An agent is a versioned bundle of two files: ```text theme={null} agent.jsonc name, description, model, skills, env keys, connectors and apps (with per-tool permission decisions nested inline), browser settings prompt.md the system prompt ``` The format of `agent.jsonc` is published as a JSON Schema at `https://api.prod.major.build/public/agent.schema.json`. Environment variable values are never stored in the bundle: declare the key, then fill in the value in the agent panel in the web app. Values are encrypted and kept across versions. ## Building an agent You build agents by describing them. Ask the [Platform Agent](/build/platform-agent) in the web app, or any AI client connected through [MCP](/build/mcp), and it drafts the prompt, researches the connectors and apps it should use, and attaches them. You refine it by asking ("use the production database", "never let it delete anything"). You can also edit the two files yourself with the [CLI](/reference/cli/agent). 1. Create the agent. It starts as a private **draft**. 2. Describe its purpose. The system prompt, connectors, apps, and skills are drafted for you. 3. Review the auto-applied [tool permissions](/learn/agents/tool-permissions) and adjust if needed. 4. **Save** as often as you like. Each save is a new immutable version and changes nothing for anyone running the agent. 5. **Publish** to make the latest saved version live. An agent with no published version can't be run. > [!NOTE] > > Drafts stay private to you until you publish. Published agents can be [shared](#sharing-and-access) with others in your organization. You can roll back by publishing an earlier version. ## Running an agent Start a new chat and pick your agent, and it runs with the prompt, connectors, skills, and permissions you configured. Agents can also run without a person in the loop: > [card] [Workflows](/learn/workflows/overview) > > Use the agent as a step in a multi-step workflow. > [card] [Triggers](/learn/triggers/overview) > > Run an agent from a workflow on a schedule, a connector event, or a webhook. > [card] [App triggers](/learn/triggers/app-triggers) > > Let your deployed apps start and manage agent runs. > [card] [External channels](/learn/agents/external-channels) > > Deploy the agent as its own Slack bot to receive and reply in channels. ## Sharing and access Agent access is role-based - **User** (run), **Editor** (edit and publish), and **Admin** (share) - and an agent can be shared with individuals or groups. When an agent is shared and run by someone other than its author, Major uses per-user credentials where a connector requires them, so each runner acts as themselves. > [card] [Access & Permissions](/learn/agents/access) > > Full RBAC details for agents and skills. # Tool Permissions Source: https://docs.major.build/learn/agents/tool-permissions Control which connector tools and app endpoints an agent can use. Tool permissions give you fine-grained control over what an agent is allowed to do. Every connector tool and every endpoint of an attached app can be set to one of three decisions: | Decision | Behavior | | - | - | | **Always allow** | The agent uses the tool immediately, no prompt. | | **Ask** | The agent must request approval before each use - interactively in chat, or routed to a Slack [approval channel](/learn/workflows/overview) when the agent runs unattended in a workflow. | | **Always deny** | The tool is blocked and hidden from the agent. | ## Smart defaults When you add a connector or app to an agent, Major applies safe defaults automatically so you don't have to configure every tool by hand: * **Read-only operations** -> **Always allow**. Reads are determined by the connector's read-only flag or, for app endpoints, by safe HTTP methods (`GET`, `HEAD`, `OPTIONS`). * **Write or delete operations** -> **Ask**, so changes to your data are surfaced before they happen. You only need to change a default when you want tighter or looser control than the default provides. ## What you can scope * **Connector tools** - each tool a connector exposes (for example, `slack_post_message` or `gmail_search_threads`). * **App endpoints** - each route of a deployed app's API, identified by method and path (for example, `POST /api/invoices`). > [!NOTE] > > The read-only PostgreSQL tool is `postgresql_query` (previously `postgresql_psql`). It runs one SQL statement, such as `SELECT`, `SHOW`, or `EXPLAIN`, in a read-only transaction. psql backslash commands like `\d` aren't supported, so agents inspect schemas with `information_schema` or `pg_catalog` queries. Decisions you set on `postgresql_psql` carry over to `postgresql_query`. Writes still go through `postgresql_invoke`. ## Enforcement Permissions are resolved at the start of each agent run and enforced on every tool call. Denied connector tools are removed from what the agent can call, and denied app endpoints are filtered out of the API documentation the agent sees - so the agent never even attempts them. A summary of its restrictions is included in the agent's instructions so it understands its own boundaries. > [!NOTE] > > Permission changes take effect on the agent's next run. A run that's already in progress keeps the permissions it started with. # Agents client Source: https://docs.major.build/learn/apps/agents-client Start and manage agent runs from your app's server code with @major-tech/agents-client. `@major-tech/agents-client` lets an app's server code start [agent](/learn/agents/overview) runs, read their messages, send follow-ups, stop them, and answer their tool approvals. For when to use it and who a run acts as, see [App triggers](/learn/triggers/app-triggers). ## Add an agent to your app Each agent your app calls gets a generated client in the app's `clients/` folder (`src/clients/` if the app has a `src` directory). The client is bound to the agent's id and reads the app's credentials from the environment, so there is nothing to configure. > [tab] Platform Agent or MCP > > Ask for it: "Use the support-bot agent from this app." The client is generated for you and the import line is added to your code. > [tab] Locally > > From the app's root, with the agent's id (find it with [`major agent list`](/reference/cli/agent)): > > ```bash theme={null} > npx @major-tech/agents-client add support-bot "Handles support tickets" > ``` > > This records the agent in `agents.json` and writes `clients/supportBot.ts`. Remove it with `npx @major-tech/agents-client remove support-bot`, and list configured agents with `npx @major-tech/agents-client list`. Then import the client: ```typescript theme={null} import { supportBotClient } from "./clients"; ``` > [!WARNING] > > Always use the generated client. When you deploy, Major reads your code to find which agent ids the app uses and only allows those. An id it can't see in the code, such as one read from an environment variable or built at runtime, isn't allowed, and calls with it fail with `AgentsAuthError`. To stop calling an agent, delete the code that uses it and remove its client. ## Server code only Use the client in Server Components, Server Actions, and Route Handlers, never in client components. It sends the app's `MAJOR_JWT_TOKEN`, which must not reach the browser. The same credentials are injected while you build and after you deploy, so you can test the whole loop in the editor preview. ## Start a run ```typescript theme={null} const { runId } = await supportBotClient.run({ prompt: "Summarize today's unread email and flag what needs a reply.", name: "Daily email summary", // optional, shown in the Major UI }); ``` `run()` returns `{ runId, status: "started" }` as soon as the run is accepted. The agent runs in the background, so render a pending state and poll for results. Pass `runId` to every other method. ## Read a run's messages ```typescript theme={null} const page = await supportBotClient.getAgentContent(runId, { limit: 20 }); for (const msg of page.messages) { // msg: { role, type, content, timestamp } } // Read the page before it if (page.nextToken) { const older = await supportBotClient.getAgentContent(runId, { limit: 20, nextToken: page.nextToken, }); } ``` Each page holds the newest `limit` messages (1-100), oldest first. `role` is `user`, `assistant`, or `system`. `content` depends on `type` (`message`, `thinking`, `tool_use`, `tool_result`, `result`, and system types), so render it defensively. ## Send a follow-up, stop, and list runs ```typescript theme={null} // Send a follow-up. If the run already finished, this resumes it on the same runId. await supportBotClient.sendMessage(runId, "Now draft replies for the urgent ones."); // Stop a run. Stopping a finished run still succeeds. await supportBotClient.stopAgent(runId); // Runs of this agent, started by this app, that are still executing. const running = await supportBotClient.getRunningInstancesOfAgent(); // [{ runId, agentId, status: "running", startedAt }] ``` An app can only manage runs it started. ## Answer tool approvals If the agent has tools set to **Ask** (see [Tool permissions](/learn/agents/tool-permissions)), the run pauses when it wants to use one. Your app can show the pending call and let the user decide without leaving the page. ```typescript theme={null} const pending = await supportBotClient.listPendingApprovals(runId); // [{ approvalId, toolName, toolArgs, description?, expiresAt? }] await supportBotClient.respondToApproval(runId, pending[0].approvalId, { approved: true, feedback: "Looks right.", // optional, useful on a denial remember: false, // true stops prompting for this tool on future runs }); // { status: "recorded" } ``` * Show `toolName` and `toolArgs` so the user sees exactly what will run. Use `description` as a summary when it's present. * An approval left unanswered is denied at its `expiresAt` time, and the run continues. * Poll `listPendingApprovals` when the user opens the run or on a sensible interval, not in a tight loop. The run is already paused. ## Methods | Method | Returns | | - | - | | `run({ prompt, name? })` | `{ runId, status: "started" }` | | `getAgentContent(runId, { limit?, nextToken? })` | `{ messages, nextToken? }` | | `sendMessage(runId, message)` | `{ status: "queued" }` | | `stopAgent(runId)` | `{ status: "stopped" }` | | `getRunningInstancesOfAgent()` | `AgentRun[]` | | `listPendingApprovals(runId)` | `PendingApproval[]` | | `respondToApproval(runId, approvalId, { approved, feedback?, remember? })` | `{ status: "recorded" }` | All types are exported from `@major-tech/agents-client`. ## Errors Every error extends `AgentsClientError`, which carries `httpStatus` and `requestId` (include the request id when you contact support). Branch on the subclass rather than parsing messages: | Error | When | | - | - | | `AgentsValidationError` | Invalid input, such as a missing `prompt` or `message`. | | `AgentsAuthError` | The app's deployer can't use the agent, or the generated client is missing or out of date. Regenerate the client. | | `AgentNotFoundError` | Unknown run or agent, a run this app didn't start, or an approval that is no longer pending. Re-fetch and re-render. | | `AgentRunNotStartedError` | The run couldn't start or accept the message: the organization is out of credits, a safety rule rejected the message, or the Major API was unreachable. Show the error; don't retry in a loop. | ```typescript theme={null} import { AgentRunNotStartedError } from "@major-tech/agents-client"; try { await supportBotClient.sendMessage(runId, text); } catch (err) { if (err instanceof AgentRunNotStartedError) { return { error: err.message }; } throw err; } ``` ## Costs Every run is a real agent session and uses credits. Start only the runs a page needs, and never start runs in a render loop or recursively. ## If the agent should call your app back Triggering an agent doesn't let it call your app. If the agent should write results to the app or call its endpoints, add the app to the agent's applications and publish the agent. Otherwise its requests to the app are rejected with HTTP 403. See [Agents](/learn/agents/overview#what-makes-up-an-agent). # AI proxy Source: https://docs.major.build/learn/apps/ai-proxy Call Anthropic, OpenAI, and Gemini from your app without API keys, billed to your Major credits or your organization's own provider keys. The AI proxy lets your app call Anthropic, OpenAI, and Gemini through Major. You use each provider's official SDK as usual, but point it at the proxy and authenticate with the app's Major token instead of a provider API key. Usage is billed at cost against your organization's credits and shows up in the [usage dashboard](/settings/billing#usage-dashboard). > [!NOTE] > > On the Enterprise plan, admins can add the organization's own provider API keys in [Settings > Models](/settings/models#use-your-own-provider-api-keys). Calls to a provider with an organization key run on that key and don't use credits. Your code doesn't change: keep using `MAJOR_JWT_TOKEN`, never the provider key. ## Example requests * "Add a Summarize button that uses Claude to summarize the selected ticket." * "Classify each new lead as hot, warm, or cold with GPT and store the label." * "Generate a product image from the description field with Gemini." ## Enable it for an app The proxy is enabled per app. When you enable it, the app gets a default monthly spending limit of \$10. > [tab] Editor > > Open the app in the editor, go to the **Settings** tab, and turn on **Enable AI proxy for this app** in the **AI Proxy** section. You can change the monthly spending limit there. > [tab] CLI > > From the app's directory: > > ```bash theme={null} > major app ai-proxy status # enabled? and this month's spend > major app ai-proxy enable # enable with the default $10/month limit > ``` > > See [`major app`](/reference/cli/app). > [tab] Platform Agent > > Ask for a feature that needs a model. The Platform Agent checks whether the proxy is enabled and asks before enabling it. ## Use it in your code Two environment variables are available in the app's runtime, in the editor preview, and after deploy: | Variable | Use | | - | - | | `MAJOR_AI_PROXY_URL` | Base URL of the proxy. Append the provider prefix: `/anthropic`, `/openai`, or `/genai`. | | `MAJOR_JWT_TOKEN` | The app's token. Pass it as the SDK's `apiKey`. Requests without it are rejected. | Call the proxy from server code only, so the token never reaches the browser. Use the provider's own SDK, not a unified SDK, and never hard-code keys or proxy URLs. > [!NOTE] > > The proxy only accepts requests that come from Major's network: the editor preview, deployed apps, and Major sandboxes. Requests from anywhere else, such as an app you run on your own machine, are rejected with `403`. ```typescript Anthropic theme={null} import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: process.env.MAJOR_AI_PROXY_URL + "/anthropic", apiKey: process.env.MAJOR_JWT_TOKEN, }); const message = await client.messages.create({ model: "claude-sonnet-4-6", max_tokens: 1024, messages: [{ role: "user", content: "Summarize this ticket: ..." }], }); ``` ```typescript OpenAI theme={null} import OpenAI from "openai"; const client = new OpenAI({ baseURL: process.env.MAJOR_AI_PROXY_URL + "/openai", apiKey: process.env.MAJOR_JWT_TOKEN, }); const completion = await client.chat.completions.create({ model: "gpt-4.1", messages: [{ role: "user", content: "Classify this lead: ..." }], }); ``` ```typescript Gemini theme={null} import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: process.env.MAJOR_JWT_TOKEN, httpOptions: { baseUrl: process.env.MAJOR_AI_PROXY_URL + "/genai" }, }); const response = await ai.models.generateContent({ model: "gemini-2.5-flash", contents: "Write a product description for ...", }); ``` For Gemini, set `httpOptions.baseUrl` to the `/genai` prefix only. The SDK adds `/v1beta/models/...` itself. Streaming (`generateContentStream`) and token counting (`countTokens`) use the same client. ### Images and audio ```typescript theme={null} // OpenAI: text to image, image edit const image = await openai.images.generate({ model: "gpt-image-1", prompt: "A white siamese cat", size: "1024x1024" }); const edited = await openai.images.edit({ model: "gpt-image-1", image: fs.createReadStream("input.png"), prompt: "Add a top hat" }); // OpenAI: text to speech, speech to text const speech = await openai.audio.speech.create({ model: "tts-1", voice: "alloy", input: "Hello!" }); const transcript = await openai.audio.transcriptions.create({ model: "whisper-1", file: audioFile }); // Gemini: image model through generateContent; the image comes back as inlineData parts const res = await ai.models.generateContent({ model: "gemini-2.5-flash-image", contents: "A banana dish in a fancy restaurant" }); // Gemini: Imagen through generateImages const imagen = await ai.models.generateImages({ model: "imagen-3.0-generate-002", prompt: "Robot holding a red skateboard", config: { numberOfImages: 1 } }); ``` Image endpoints are stateless: input images live only in that request's body, and nothing is stored on the server. ## Supported endpoints Only these endpoints are available. Requests to any other path are rejected. | Provider | Endpoints | | - | - | | Anthropic | `/v1/messages`, `/v1/messages/count_tokens` | | OpenAI | `/v1/chat/completions`, `/v1/responses`, `/v1/audio/speech`, `/v1/audio/transcriptions`, `/v1/images/generations`, `/v1/images/edits`, `/v1/images/variations` | | Gemini | `/v1beta/models/{model}:generateContent`, `:streamGenerateContent`, `:countTokens`, `:generateImages` | Not supported: embeddings, video generation, file uploads, the OpenAI Assistants API, and Gemini cached contents, tuning, and the Live API. ## Spending limits and errors Each request is checked before it reaches the provider: | Error | Status | Meaning | | - | - | - | | `missing_authorization` | 401 | No token was sent. Pass `MAJOR_JWT_TOKEN` as `apiKey`. | | `invalid_token` | 401 | The token is invalid or expired. | | `proxy_disabled` | 403 | The proxy isn't enabled for this app. | | `spending_limit_exceeded` | 403 | The app reached its monthly spending limit. Raise the limit or wait for the next month. | | `insufficient_balance` | 403 | Your organization is out of credits. See [Billing](/settings/billing). | The monthly limit counts only this app's proxy usage and resets at the start of each month. Calls that run on your organization's own provider keys count toward it at the provider's list price. If your organization uses its own key for a provider, two more cases can fail a request: * The provider rejected the organization's key (invalid, out of credits, over a spend limit, or suspended). The error names the provider and asks you to contact your organization admin. Requests on your own key never fall back to Major's keys. * An admin [turned off the provider](/settings/models#turn-off-a-model-provider). Requests to a turned-off provider are refused. > [!NOTE] > > Agents and the Platform Agent choose their models separately. See [agent models](/learn/agents/models) and [Settings > Models](/settings/models). # Authentication (AuthN) Source: https://docs.major.build/learn/apps/authentication Identify the current user in your Major app. Major exposes the logged-in user's identity through a single import - `@lib/auth.ts`. This is strictly authentication (AuthN): confirming *who* the user is. Authorization - deciding *what* they can do - is your app's responsibility. This allows builders to build authn directly into their Major Apps. # Deploying Source: https://docs.major.build/learn/apps/deploying Ship your apps to production. Major integrates with GitHub to version-control your applications. See [Source Control](/learn/apps/overview#source-control) for an overview of how repository hosting works. Deployments are triggered from the editor toolbar. Each deployment is tied to a specific Git commit, giving you a full audit trail of what shipped and when. ## Publish The **Publish** button in the editor toolbar gives you a single place to deploy your app, set a custom URL slug, toggle public access, and get AI help with deployment errors. When your app is published, a **Copy link** button appears, allowing you to quickly copy your deployment URL to share with users. ## Share The **Share** button lets you manage access to your app with granular role-based permissions (Admin, Editor, Viewer). Add team members by email and control what they can do. ## Public and Private Apps Deploy apps publicly (no authentication required) or privately (auth-gated). Public apps are accessible to anyone with the URL. Private apps require users to sign in and have the appropriate permissions. ### Disabling public apps > [!NOTE] > > Available on the Enterprise plan. Only organization admins can change this setting. Organization admins can block every app in the organization from being made public: 1. Go to **Organization Settings > Organization**. 2. Turn on **Disable public apps**. 3. Review the list of apps that will be made private, then click **Disable public apps** to confirm. Turning the setting on makes every public app in the organization private right away. While it's on: * No app can be made public. The **Public access** toggle is hidden from the app's share panel, and the **Access** filter is hidden from the apps library. * Requests to make an app public fail with the error "Your organization has disabled public apps." Turning the setting back off lets apps be made public again, but doesn't make any app public on its own. You can turn it off even if your organization is no longer on the Enterprise plan. ## Login Redirects When a user visits a private app while logged out, Major redirects them to sign in. After they log in, they're redirected back to the app they originally visited. This works with both custom slug-based hostnames (e.g., `my-app.apps.prod.major.build`) and hash-based hostnames. ## Custom URL Slugs When deploying for the first time, you can choose a custom subdomain for your app (e.g., `my-app.apps.prod.major.build`). Existing apps can update their URL slug in application settings. ## Per-User OAuth in Deployed Apps If your app uses resources configured for **per-user** authentication, Major automatically enforces an OAuth gate. When a user accesses the app without a connected OAuth account, they're redirected to the `/connect` page to authorize access. Users can manage their connected accounts from **Settings > Connected Accounts**. See [Per-User OAuth](/learn/connectors/overview#shared-vs-per-user-connections) for details on how this works. ## Stop When Idle Apps built on the Vite-Hono template can stop their backend while nobody is using them. Open the app's **Scaling** tab and use the **Stop when idle** switch on the deployed app. * When it's on, the backend stops after 15 minutes without traffic. While it's stopped, it costs nothing. * The next request starts it again. That first request takes a few seconds; requests after it are served as normal. * New Vite-Hono apps have it on by default. Turn it off to keep the backend always running. * Changing the switch redeploys the app. Next.js apps, and previews in the editor, are always on and don't show the switch. ## Version History View a complete history of your application's versions. Each version is linked to a commit, ensuring full traceability of changes. ## Redeploying When you redeploy a previously deployed version, you can force a fresh build with the **Redeploy** button even if the version was cached. This rebuilds the app from scratch rather than reusing cached artifacts. ## Build Progress While the AI is building your app, a tips overlay displays helpful guidance about connectors, sharing, iterative prompting, and published app URLs. If your app uses Slack, the overlay prompts you to deploy it with a relevant app slug after the build completes. Use the navigation controls to cycle through tips and learn best practices as you wait for the build to complete. # Domains Source: https://docs.major.build/learn/apps/domains Connect your application to a branded domain name. When you publish an app on Major, it always gets an internet-accessible URL. By default that's a `usemajor.dev` subdomain, but you can also serve apps from your own branded domain - for example, `dashboard.acme.com` instead of `acme-dashboard.usemajor.dev`. Custom domains are configured in two steps: 1. An **organization admin** verifies a domain you own (e.g. `acme.com`) by adding two DNS records. 2. Any **builder** can then pick a subdomain (e.g. `dashboard.acme.com`) when publishing an app on the verified domain. Custom domains are currently **free of charge**. ## Set up an organization domain Adding a domain is a one-time, organization-level action that any admin can perform from **Settings > Domains**. 1. Go to **Settings > Domains** and click **Add Domain**. 2. Enter the root domain you own (e.g. `acme.com`). 3. Major shows you two CNAME records to add at your DNS provider: | Record | Type | Target | | - | - | - | | `*.acme.com` | CNAME | `cname.major.build` | | `_acme-challenge.acme.com` | CNAME | `_acme-challenge.acme.major.build` | 4. Add both records in your DNS provider's dashboard. 5. Major automatically polls DNS, validates ownership, and issues an SSL certificate. > [!NOTE] > > The wildcard CNAME (`*.acme.com`) is what makes the rest of the flow zero-touch. Once it's in place, every new subdomain you assign to an app routes to Major's infrastructure without any further DNS changes. ### Verification status After you add a domain, it progresses through these states on the Domains page: * **Pending DNS** - Major is waiting to see your CNAME records resolve. * **DNS verified** - Records found; certificate provisioning has started. * **Provisioning certificate** - Major is requesting an SSL certificate from Let's Encrypt. * **Active** - The domain is live and ready to be assigned to apps. * **Certificate failed** - Issuance failed, usually because the `_acme-challenge` CNAME is missing or misconfigured. DNS propagation can take a few minutes, and certificate issuance typically completes within ten. Major keeps polling for up to 48 hours, so it's safe to add the DNS records later - the domain just stays in **Pending DNS** until they appear. Note: If DNS verification has not succeeded in 48 hours, you can make another verification attempt by clicking **Retry DNS verification**. > [!TIP] > > SSL certificates are issued by Let's Encrypt using a DNS-01 challenge against the `_acme-challenge` CNAME. Renewals happen automatically before expiry - you never need to touch the records again. ## Assign a domain to an app Once an organization domain is **Active**, any builder with edit access on an app can pick a subdomain on it: 1. Open the app in the editor and click **Publish**. 2. In the URL picker, choose the verified organization domain. 3. Enter the subdomain you want (e.g. `dashboard` for `dashboard.acme.com`). 4. Click **Publish**. You can assign a custom domain on the very first deploy of an app - there's no need to publish to a `usemajor.dev` URL first. The subdomain is reserved as soon as you confirm it; routing goes live as soon as the deployment completes. You can also assign a custom subdomain to an already-deployed app - it becomes the app's primary URL immediately. ### Multiple subdomains per app A single app can be served from multiple subdomains at once (for example, both `dashboard.acme.com` and `app.acme.com`). Add additional subdomains from the app's URL settings. ## Authentication on custom domains Custom domains work for both **public** and **private** apps. * **Public apps** load directly with no sign-in. * **Private apps** still require an authenticated Major session. We perform a one-time auth handshake the first time a user visits a custom domain: 1. The user is redirected to `app.major.build` to confirm they're signed in and have permission to view the app. 2. They're redirected back to your custom domain with a short-lived session cookie scoped to it. 3. Subsequent visits skip the redirect - the cookie is valid for 7 days. Permissions are re-checked on every request, so removing a user's access takes effect immediately even if their cookie hasn't expired. ## Limits | Resource | Limit | | - | - | | Organization domains | 10 per organization | | Subdomains | 20 per application | ## Removing a domain * **Removing a subdomain from an app** - Open the app's URL settings and remove the entry. The last URL on an app cannot be removed; if a custom domain is the only URL, you must add another (a `usemajor.dev` slug or a different subdomain) before removing it. * **Removing an organization domain** - Go to **Settings > Domains** and delete the domain. You must first remove every app subdomain that uses it. ## Not supported A few configurations are intentionally not available today: * **Apex domains.** You can use `dashboard.acme.com` but not `acme.com` itself as an app URL. * **Multi-level subdomains.** `api.acme.com` works; `api.v2.acme.com` does not - the wildcard certificate covers exactly one level. * **Bring-your-own certificates.** All certificates are issued by Major via Let's Encrypt. * **Frontend-only (Vite) apps.** Custom domains are available for full-stack (Next.js) apps only. # Editor Source: https://docs.major.build/learn/apps/editor Edit an app with the Platform Agent, a live preview, and the code view. The Major Editor provides a collaborative environment to modify your applications with AI assistance. # Building with AI The editor includes an AI assistant with full context of your application code. You describe what you want to build or change in the chat panel, and the AI reads your codebase, asks clarifying questions if anything is ambiguous, and works through the implementation with you. ## Images and Attachments You can attach images and files to your AI chat messages. Drag and drop or paste screenshots, mockups, or reference images directly into the chat. Supported file types include: * **Images** - PNG, JPG, GIF, and other common formats up to 5MB. * **PDFs** - for documentation or design references up to 5MB. * **Office Documents** - .docx, .pptx, .xlsx files up to 10MB. * **Text files** - plain text files up to 100KB. * **Markdown files** - .md files up to 100KB. * **JSON files** - .json files up to 100KB. The AI uses these attachments as context when building or modifying your app - useful for matching a specific design, reproducing a bug from a screenshot, referencing documentation, or providing structured data for implementation. ## @ Mentions Type `@` in the chat to explicitly reference connectors, attachments, and workspace files in your message. This tells the AI exactly which resource or file you're talking about. ## Tool Cards When the AI executes resource operations in the chat, tool cards display the operation being performed. Each tool card shows: * **Tool name in plain text**: The name of the tool being invoked, displayed as readable text. * **Tool description**: A brief description of the tool appears below the tool name for clarity. * **Arguments with descriptions**: Input parameters are labeled with human-readable descriptions and resolved resource names where applicable. * **Formatted output**: Results are displayed with proper JSON formatting for clarity. ## Approvals & User Input When your app requires approval before executing a tool or needs input from you, approval and ask-user cards render directly within the chat message flow. You no longer see separate overlay windows - everything stays in context within the chat. When an approval request or ask-user prompt is active, the chat input area switches to feedback mode: * The input field becomes a response/feedback field for that specific request * Toolbar actions are hidden to focus on the immediate decision * Attachments are stashed temporarily and restored once the request is resolved Respond directly in the input field to approve the action, provide feedback, or answer the question. Once resolved, the chat resumes normal operation and any stashed attachments are available again. ### Environment Variable Setup Requests When the AI needs to set up environment variables, it sends a setup request that you can approve or decline. If you decline an environment variable setup request, you can include optional feedback explaining why. Your feedback is captured and sent back to the AI immediately via the control channel, and it also appears in the chat message history for future reference. ## Queued Messages You can send follow-up messages while the AI is still working. Queued messages appear with a "Queued" label and a "Cancel" button. They are processed in order once the current task completes. You can cancel a queued message before it's picked up. When you send a new message while the AI is waiting for your approval or decision, the pending decision is automatically interrupted and the agent resumes immediately with your new message. ## Auto and Manual Approvals Edit chats start in **Auto** approvals. An auto reviewer decides tool approvals for you and denies calls it judges risky, and the AI can then ask you about them. Switch to **Manual** to approve each call yourself. See [Auto and Manual](/build/platform-agent#auto-and-manual) for how the reviewer decides and what still comes to you. ## Preview & Inspection Every editing session runs a live preview of your application in the right panel. As the AI makes changes, the preview updates automatically so you can verify behavior before committing. The panel includes three tabs: * **Preview** - the running application, updated in real-time as changes are made * **Code** - the generated source code for your application * **Log** - runtime logs from the application, useful for debugging errors or verifying behavior ### Visual Selector The visual selection tool lets you click elements in the preview to reference them in your AI chat. Hold Cmd (Mac) or Ctrl (Windows/Linux) to select multiple elements - each appears as a dismissible badge in the chat input. This is useful for telling the AI "change this button" or "fix the layout of these two components." The preview's URL bar shows all available routes as an autocomplete dropdown, making it easy to navigate your app. Use the **Back** and **Forward** buttons next to it to step through the pages you've visited in the preview, like in a browser. ## TypeScript Intelligence The AI assistant has built-in TypeScript language server support, giving it precise code navigation across your codebase - go to definition, find references, and symbol lookup. This means the AI can understand your type relationships and imports accurately instead of relying on text search. ## Session Persistence Sessions persist across reconnections. When you resume a session on the same app, your conversation history and workspace state are automatically restored, so you pick up right where you left off without re-cloning or reinstalling dependencies. To start the agent fresh on an unrelated task, say "clear context" in chat. The agent will reset its context window while keeping the code changes already in your repository intact. ## Debugging Logs The AI assistant can query logs from both your live preview and your deployed application. * **Preview logs** - logs from the local dev server running in your current session. Use these to debug build errors, hot-reload issues, or runtime problems during development. * **Production logs** - logs collected from your deployed app's container stdout/stderr. Use these to investigate issues in production. Ask the AI to investigate an error and it will search the appropriate log source automatically, correlate messages with your code, and suggest fixes. # Environment Variables Source: https://docs.major.build/learn/apps/environment-variables Configure per-app environment variables. Define environment variables per application in the **Environment Variables** panel. These variables are automatically injected into the live preview, build pipeline, and deployments. ## Live Reload When you update or delete an environment variable, the preview automatically reloads with the changes - no restart needed. ## System Variables System variables like `MAJOR_API_BASE_URL` cannot be overridden. Any variable with the `MAJOR_` prefix is reserved. ## Deployed Apps After changing environment variables in a deployed app, click **Redeploy** to apply them to the live deployment. Environment variable changes do not take effect on deployed apps until redeployed. ## CLI You can also manage environment variables from the CLI. Environment names are case-insensitive, so `--env staging` and `--env Staging` resolve to the same environment. See [`major vars`](/reference/cli/vars) for details. # Environments Source: https://docs.major.build/learn/apps/environments Configure connectors differently for staging and production. Environments let you maintain separate resource configurations for different stages. Use a staging database for testing and production credentials when you deploy. ## Creating environments 1. Go to **Settings > Environments** 2. Click **Add Environment** 3. Enter a name (e.g., "staging") 4. Click **Create** Every organization has a **default** environment that represents production. This environment cannot be deleted or renamed. ## Configuring connectors per environment When you edit a resource, you can configure each environment independently: 1. Go to **Organization Settings > Connectors** 2. Click on a connector to edit it 3. Select the desired environment 4. Enter the connection details for that environment 5. Click **Save** ### Example | Environment | Host | Database | | - | - | - | | default | prod.example.com | myapp_prod | | staging | staging.example.com | myapp_staging | > [!TIP] > > If an environment has no specific configuration, it falls back to the default environment's settings. ## Default Build Environment Organizations can designate a separate "default build environment", distinct from the production environment. It is the environment you work in until you [choose one yourself](#your-environment-choice). This is useful for testing and development workflows where you want the AI to work against staging data. ### Setting a default build environment 1. Go to **Settings > Environments** 2. In the environment list, select the **Set as default build** option next to your chosen environment 3. The environment will be marked with a "Default" badge > [!NOTE] > > Production deployments always use the default (production) environment, regardless of the default build environment setting. ## Your environment choice Each person picks one environment per organization: their **environment choice**. It is yours, not an app's, so it applies to everything you do by hand: | Where the resource call comes from | Environment it uses | | - | - | | Your app previews (in the web editor and with `major app start`) | Your choice | | Your [Platform Agent](/build/platform-agent) chats | Your choice | | [MCP clients](/build/mcp) and the CLI | Your choice | | An agent run started by your app preview | Your choice | | Deployed apps, other agent runs, workflows, and schedules | Default (production) | Until you pick an environment, the calls that follow your choice use the organization's default build environment. If your organization has only one environment, there is nothing to choose and the environment selector and tools don't appear. ## Selecting environments in the web editor The web editor includes an environment selector in the **bottom right** of the preview. Click it to switch between available environments. When you switch environments: * Your environment choice changes for every app, not just this one * Every app preview you have open reloads with the new resource configuration * API calls use the selected environment's credentials * Preview reflects the environment-specific data The editor's resource test panels (query tests, and the database and file storage inspectors) each have their own environment picker. They start on the default environment and don't follow your environment choice. ## Selecting environments from MCP clients and chats In an organization with more than one environment, the Platform Agent and [MCP clients](/build/mcp) have two tools: * `get_environment` shows the environment your resource calls use, whether you chose it or it's the default build environment, and lists the organization's environments. * `set_environment` switches your environment choice by name. Your open app previews reload in the new environment. Agents don't get these tools. They always run in the default environment. > [!NOTE] > > Production deployments always use the default environment. # Errors Source: https://docs.major.build/learn/apps/errors Monitor and debug runtime errors from your deployed apps. The **Errors** panel displays runtime errors from your deployed applications. Use it to identify issues in production, understand error patterns, and resolve problems quickly. ## Error Details Each error displays: * **Error message** - the exception text thrown by your app * **Stack trace** - the full call stack showing where the error originated * **Environment context** - environment variables, request details, and app state at the time of error * **Occurrence count** - how many times this error has occurred Errors are automatically collected from your app's container runtime and organized by error type and frequency. ## Automatic Error Collection Errors from your application are automatically collected and aggregated - no additional configuration needed. Major captures runtime errors from your app code and surfaces them in the Errors panel. > [!NOTE] > > Major only accepts error reports sent from its own network, which covers deployed apps and the editor preview. Reports from an app you run on your own machine are rejected. ## Ask AI to Fix Click the **Ask AI to fix** button on any error to send the full error details to the AI chat in the editor. The AI uses the message, stack trace, and context to: * Identify the root cause * Suggest code changes to resolve the issue * Walk you through the fix step-by-step This shortcut skips copying and pasting error details manually - the AI has everything it needs to start debugging immediately. ## Filtering and Search The panel updates automatically as new errors occur in your deployed app. You can review error history to spot patterns and address systemic issues before they affect more users. # Managed Databases Source: https://docs.major.build/learn/apps/managed-databases Provision and manage PostgreSQL databases for your app. Each app can have its own managed PostgreSQL database - no external setup required. Ask the AI assistant to provision one, or use the **Database** tab in the editor. ## Provisioning Ask the AI assistant to provision a managed database, or click **Provision** in the Database tab. Your app gets its own PostgreSQL instance, ready to use with the same generated clients as any other connector. When the AI assistant provisions the database, it doesn't ask you to approve the step first. You need edit access to the app. [Migrations](#migrations) still ask for approval. ## Inspecting Data Click **Browse tables and data** to explore your database: * Browse tables and view row data with pagination and sorting * Click rows to see full details * View table schema - columns, primary keys, foreign keys, and indexes ## Migrations Run database migrations through the AI assistant. Ask the AI to apply a schema change - it writes the migration SQL, shows it to you with syntax highlighting for review, and applies it atomically across all environments once you approve. Migrations are recorded in an audit log so you can track what changed and when. The AI uses the `postgresql_run_migration` tool, which validates SQL before execution and requires admin permission. Only managed (not external) databases support this flow. ## Multi-environment schemas When you create a new environment, Major automatically provisions a matching PostgreSQL schema for it, cloned from the default environment's structure. Deleting an environment drops its schema. ## Access Control App collaborators (admins and editors) automatically get database access synced from your resource permissions. Managed databases are scoped to your app and can be configured per-environment. ## Deleting a Database You can delete a managed database from three locations: * **Resource Details Sheet** - click the "Delete Database" button * **Database Settings** - available for failed or active databases * **Database Panel** - use the trash icon in the header or the delete button in the failed state Deletion requires type-to-confirm for safety. Once deletion starts, the database transitions to a "Deleting database..." state. > [!WARNING] > > Database deletion is permanent. Ensure you've backed up any important data before proceeding. # Overview Source: https://docs.major.build/learn/apps/overview Build, configure, and deploy internal tools as full-stack apps. An **app** is a self-contained project you build, deploy, and share through Major. Use the AI-powered [web app](/learn/web-app) or your own tools through the [MCP](/build/mcp) and [CLI](/build/cli) to develop it, [deploy](/learn/apps/deploying) it to production, configure [environments](/learn/apps/environments) for staging and production, and [share](/settings/members-and-roles) it with your team. ## Lifecycle 1. **Create** - Build with the Platform Agent, the MCP, or the CLI. 2. **Connect** - Attach [connectors](/learn/connectors/overview) (databases, APIs). 3. **Deploy** - Ship to production with one command or click. 4. **Share** - Grant access to teammates with [roles](/settings/members-and-roles). ## Source control Every app is backed by a Git repository. Major hosts repositories by default, but you can [connect your own GitHub organization](/settings/github-app) at any time. Either way, the code is yours - clone, branch, and manage it with any Git tooling. # Queries Source: https://docs.major.build/learn/apps/queries Inspect and edit database queries in your app. The **Queries** panel shows every database query discovered in your application's codebase. Queries are organized by resource, and each entry includes the invocation key and the file location where it appears. You can edit a query string directly from this panel. Changes are saved back to your source code. The panel updates automatically whenever commits are pushed to the main branch, so it always reflects your current codebase. # Theming & Branding Source: https://docs.major.build/learn/apps/theming Customize the look and feel of your apps. Create custom themes to control the visual appearance of your apps. Themes are defined at the organization level and can be applied to individual apps. ## Themes Go to **Organization Settings > Branding** to manage themes. * **Create themes** - define color schemes for your apps * **Set a default** - new apps automatically use the default theme * **Duplicate** - copy an existing theme as a starting point * **Preview** - see a live preview of how the theme looks Each app can use a different theme, or you can set a default that applies to all new apps. ### Color customization Customize your theme colors using color pickers: * **Base color** - the primary color used throughout your app (adjustable via Hue + Saturation) * **Theme color** - an accent or secondary color (adjustable via Hue + Saturation) This gives you precise control over your app's visual appearance without being limited to predefined colors. ### Elevation & shadows Configure how shadows and depth appear on cards and UI elements. These settings control the visual hierarchy and polish of your interface. ### Upgrading themes When Major releases new theme features or improvements, you can upgrade your existing themes to the latest version. Upgrades preserve your custom colors and settings while applying new capabilities. ## Logos Upload your organization's branding: * **Full logo** - displayed in the app header and navigation * **Icon logo** - used as a favicon and in compact views # Webhook routes Source: https://docs.major.build/learn/apps/webhook-routes Receive raw, unauthenticated HTTP callbacks from external services in your app. Receive HTTP callbacks from external services (Stripe, GitHub, Twilio, etc.) by creating routes matching `/api/webhook/*` and turning on **Webhook Access** in your app's settings. When enabled, only `/api/webhook/*` routes are publicly accessible - all other routes remain protected. > [!TIP] > > If you want an external event to start work in Major, use a [webhook trigger](/learn/triggers/webhooks) instead. Webhook triggers start a workflow and every call is authenticated with a credential, so they are the more secure and preferred option. Use webhook routes only when a service must post raw payloads to your app and can't send a credential. ## Setup Create an API route in your app under the `/api/webhook/` path: ```typescript theme={null} // src/app/api/webhook/stripe/route.ts export async function POST(request: Request) { const body = await request.json(); // Handle the webhook payload return new Response("OK", { status: 200 }); } ``` ## Security Best practice is to verify webhook signatures to ensure requests come from the expected source. Most services (Stripe, GitHub, etc.) include a signature header that you can validate against a shared secret. # Overview Source: https://docs.major.build/learn/connectors/overview How connectors give apps, agents, and workflows secure access to your data. Connectors are the databases, APIs, SaaS tools, and storage services that your apps, agents, skills, and workflows use. You configure a connector once, and Major holds its credentials and proxies every call, so secrets never appear in your code or your prompts. For the full list of supported connectors, see the [connector reference](/reference/connectors). * **Secure Flow**: Your app connects to the Major API, which proxies requests to your actual connectors. * **Authentication**: Powered by a `MAJOR_JWT_TOKEN` issued to your session. This token contains your user scopes, ensuring the client can only access what you're permitted to access. * **Generated Clients**: Major generates resource clients for you. You'll find one per resource in `src/clients/`. ## Generated clients When you attach a connector to an app, Major generates a client for it - one per resource, available at `src/clients/`. You don't wire up HTTP requests, authentication, or connection setup yourself; you import the client and call its `invoke` method. * **Type-safe** - full TypeScript support, so inputs and outputs are checked as you write against each resource. * **Tailored per resource** - each connector type gets a client with an `invoke` signature specific to it, so a Postgres query and a Slack message each use the shape that fits. * **No secrets in code** - authentication is handled by the platform, not your application. See [Resource client](/learn/connectors/resource-client) for usage and error handling. ## Setting up a connector 1. Navigate to **Connectors** 2. Click **Add Connector** and select the type 3. Configure the connection details and credentials 4. Attach the connector to your app via the web editor or `major resource manage` Connectors that call a URL you provide, such as Custom API, GraphQL, and custom MCP servers, must point at a public host. Major won't connect to loopback, private, or link-local addresses. > [!NOTE] > > Resource credentials are encrypted and never exposed to the client-side application code. When you delete a connector, Major permanently destroys its stored credentials, including every user's per-user credentials. ### Completing an OAuth or app-install connection When a connector uses OAuth (Google, HubSpot, Slack, and others) or a GitHub App install, Major only saves the grant if you finish the provider's consent screen in a browser that is signed in to Major as the same user who clicked **Connect**. If the browser is signed out of Major, signed in as someone else, or your session expired mid-flow, the connection is refused and you're asked to sign in to Major as the user who started it. Start the connection again from the browser you're signed in to. The same applies to the `/connect` links agents and apps send you: the link is safe to forward, because whoever opens it starts and completes their own connection. ## Shared vs. per-user connections When you configure a connector, you choose how it authenticates: * **Shared** - one set of credentials for everyone. The person setting up the connector provides them, and every app user and agent run uses that same account. Best for system-owned resources like a production database. * **Per-user** - each person authorizes their own account (for example, their own Google Calendar) instead of a shared login. Only some connectors - typically OAuth services - support this. The [connector reference](/reference/connectors) lists which ones do. For connectors that support it, **Per-user** is the default when you add one, and Shared is under **Advanced**. A per-user connector is named after its service (for example, "Gmail"), not after the person who created it. A new **Custom API** connector starts as **Shared**. Only its OAuth2 **authorization code** grant supports per-user, so choosing that grant switches the new connector to **Per-user**, and choosing a different grant or auth method switches it back to **Shared**. With a per-user connector, Major gates on the user's own authorization: anyone who opens an app or runs an agent without a connected account is redirected to a `/connect` page to complete OAuth, then returned where they were. Because the connector acts as whoever is using it, each person only touches data they're entitled to. Users manage the accounts they've authorized from [Connected Accounts](/settings/connected-accounts). ### The connectors list The **Connectors** page groups connectors by type, for example "Gmail 3". Types you can sign in to yourself come first. Within each type, your personal connectors come first, then managed, shared, and ones you can't access. Each row shows its connection state on a second line: | Connector | States | | - | - | | Per-user | **Signed in as** your account, **Not signed in**, or **Sign-in expired** | | Shared | **Shared** (with the account it's connected as, when known), **Not set up**, or **Needs reconnecting** | When you haven't connected a per-user connector, its row has a **Sign in** button (**Reconnect** if your sign-in expired). It starts the OAuth flow and returns you to the list. > [card] [Per-user OAuth](/learn/connectors/overview#shared-vs-per-user-connections) > > Full details on shared vs. per-user authentication modes. ## Per-environment configuration When editing a connector, you can configure each environment independently. This lets you use different credentials or endpoints for staging and production. | Environment | Host | Database | | - | - | - | | default | prod.example.com | myapp_prod | | staging | staging.example.com | myapp_staging | You can also enable **global configuration** for a resource, which uses a single configuration from the default environment across all environments instead of per-environment configs. When enabled, non-default environment tabs are locked with an explanatory tooltip. > [card] [Learn more about Environments](/learn/apps/environments) > > See how to create and manage environments for your organization. ## Resource context You can upload context files - database schemas, OpenAPI specs, API documentation, and more - to any connector. The AI assistant uses this context when writing queries and API calls against that resource, so it understands your data model without you having to explain it every time. If your app needs a connector that hasn't been set up yet, the AI will show a setup card in the chat - click it to configure the resource inline without leaving the editor. ## Custom connector logos Custom API and Custom MCP connectors can show their own brand logo instead of the generic icon, everywhere the connector appears in Major. When you create one, Major looks for a logo in the background. Connector admins can change it from the **Logo** field in the connector's settings: * **Upload** - choose an image file (PNG, JPEG, WebP, GIF, SVG, or ICO, up to 1 MB). * **Search by URL** - find the logo automatically. For a Custom MCP connector, Major first uses the icons the MCP server advertises. Otherwise it uses the icon from the website of the connector URL's domain (for example, `acme.com` for `api.internal.acme.com`). * **Remove** - go back to the default icon. To replace a logo, remove it first and then upload or search again. Changes apply right away. ## Identity-based authentication For AWS services (S3 and DynamoDB), you can use IAM Assume Role Identities instead of access keys. Create an identity in **Settings > Identities**, review the generated trust policy for your IAM role, and select identity-based authentication when configuring the resource. For GCP services (BigQuery), you can authenticate via a service account JSON key in addition to OAuth. Create a GCP identity in **Settings > Identities** to manage service accounts across resources. Identity-based authentication is more secure and avoids storing long-lived credentials. ## What uses a connector The **Used by** column on the **Connectors** page shows the apps, agents, and workflows that use each connector. It shows the first one by name, then a count of the rest (for example, `Customer Portal +5`). Click it to see the full list, with each item labeled **App**, **Agent**, or **Workflow** and linked. A connector that nothing uses shows **Not used**. * An **app** counts when its latest commit uses the connector, even if that commit isn't deployed yet. * An **agent** counts when the connector is attached to it. * A **workflow** counts when one of its live connector-event [triggers](/learn/triggers/connector-events) uses the connector. You only see the apps, agents, and workflows you have access to. ## Rate limiting Set hourly and daily invocation limits on any connector to protect downstream services from runaway usage. When a limit is reached, requests return `429 Too Many Requests` until the window resets. Configure limits when creating or editing a connector. ## Call screening Because connectors run on Major's servers, every connector call - from a generated client, a connector tool, or the [HTTP proxy](/learn/connectors/proxy-fetch) - is checked before it runs for attempts to attack Major's own infrastructure: running shell or client meta-commands on the host (for example `\!` in a Postgres query), reading the host's files, environment, or credentials, or reaching loopback, cloud-metadata, or private network addresses. Ordinary use of your data is never blocked by this check, however broad or destructive - reads, writes, deletes, and schema changes are governed by your permissions, not by screening. A call that is blocked returns `403 Forbidden` with the message "this call looks like an attempt to misuse the resource and was blocked", and is recorded as a failed invocation in the [Audit Log](/settings/audit-log). Screening applies to every organization and can't be turned off. Don't see the connector you need? Use [Custom API, GraphQL, or custom MCP](/reference/connectors) connectors, or click **Request it** in the Add Connector dialog to submit a request. # Proxy fetch Source: https://docs.major.build/learn/connectors/proxy-fetch Call any HTTP API on a connector through Major with a drop-in fetch, so third-party SDKs work without API keys. `createProxyFetch` from `@major-tech/resource-client` returns a `fetch`-compatible function that sends every request through a [connector](/learn/connectors/overview). Major checks the URL against the connector, injects the connector's credentials, and streams the response back. Your code never sees the API key. Use it when: * You want a third-party SDK that accepts a custom `fetch` (Stripe, Twilio, OpenAI-compatible APIs, and so on) to run on a connected account. * You need an endpoint the [resource client](/learn/connectors/resource-client) doesn't cover. * The connector has no generated client, such as most [catalog connectors](/reference/connectors). Prefer the resource client when it covers what you need, since it gives you typed inputs and outputs. ## Create a proxy fetch In a Next.js app, import from `@major-tech/resource-client/next` and call it from server code (Server Components, Route Handlers, Server Actions): ```typescript theme={null} import { createProxyFetch } from "@major-tech/resource-client/next"; const proxyFetch = createProxyFetch({ baseUrl: process.env.MAJOR_API_BASE_URL!, resourceId: process.env.HUBSPOT_RESOURCE_ID!, majorJwtToken: process.env.MAJOR_JWT_TOKEN!, }); const res = await proxyFetch("https://api.hubapi.com/crm/v3/objects/contacts", { method: "GET", headers: { "Content-Type": "application/json" }, }); const data = await res.json(); ``` `MAJOR_API_BASE_URL` and `MAJOR_JWT_TOKEN` are set for you in the editor preview and after deploy. The call looks like a normal `fetch` to the upstream URL. Under the hood it goes to `/v1/proxy/` with the target URL in a header. | Option | Required | Description | | - | - | - | | `baseUrl` | Yes | The Major API base URL. Use `process.env.MAJOR_API_BASE_URL`. | | `resourceId` | Yes | The connector's id. | | `majorJwtToken` | Yes | The app's token. Use `process.env.MAJOR_JWT_TOKEN`. | | `timeoutMs` | No | Default request timeout. Maximum 60000. | | `fetch` | No | A custom `fetch` implementation. Defaults to `globalThis.fetch`. | > [!WARNING] > > Pass `resourceId` as a string literal or an environment variable read at module scope. Major finds the connectors your app uses by reading your code at deploy, so an id computed at runtime isn't tracked and calls with it fail. ## Use it with an SDK Hand the proxy fetch to any SDK that accepts one. The SDK may insist on an API key in its constructor. Pass a placeholder: the proxy strips it and injects the real credential. ```typescript theme={null} import Stripe from "stripe"; import { createProxyFetch } from "@major-tech/resource-client/next"; const proxyFetch = createProxyFetch({ baseUrl: process.env.MAJOR_API_BASE_URL!, resourceId: process.env.STRIPE_RESOURCE_ID!, majorJwtToken: process.env.MAJOR_JWT_TOKEN!, }); const stripe = new Stripe("sk_unused_proxy_injects_real_key", { httpClient: Stripe.createFetchHttpClient(proxyFetch), }); const customers = await stripe.customers.list({ limit: 10 }); ``` ## Per-user connectors For connectors that use [per-user connections](/learn/connectors/overview#shared-vs-per-user-connections) (such as Gmail, Google Calendar, or Google Drive), the `/next` entry forwards the signed-in user's identity automatically, so each request uses that user's connected account. Outside a user request, such as a background job, there is no user to forward, and calls to per-user connectors fail. Shared connectors keep working. Outside Next.js, for example in a [skill](/learn/skills/overview) script or plain Node, import `createProxyFetch` from `@major-tech/resource-client` (the package root). It has no Next.js dependency and takes an optional `getUserJwt` function if you have a user token to forward. ## Headers and limits * **Don't set `Authorization`.** The proxy injects the connector's credentials and strips any `Authorization` you send. * These request headers are always stripped: `Authorization`, `Cookie`, `Host`, `Forwarded`, `X-Forwarded-*`, `X-Real-Ip`, and anything starting with `X-Major-` or `X-Pd-`. The exception is `X-Major-Timeout-Ms`, which sets the timeout for one request. * The target URL must be one the connector allows, usually the service's API host. * The target must resolve to a public address. A request to a loopback, private, link-local, or other internal address, directly or through a redirect, fails with `403` and the error `destination_blocked`. * Redirects are followed for up to 10 hops. A redirect from `https` to `http` is refused. * The target URL must use `https` and must not name a port, not even `:443`. Requests to `http://` URLs or to any explicit port are refused. * When a redirect goes to a different host, Major sends only the `Accept`, `Accept-Encoding`, `Accept-Language`, and `User-Agent` headers on that hop, so the connector's credentials and any custom headers stay on the original host. A subdomain or a different port counts as a different host. A cross-host `307` or `308` redirect that would resend the request body is refused. Redirects that stay on the same host keep all headers. * Request and response bodies are limited to 50 MB. Timeouts are capped at 60 seconds. # Resource Client Source: https://docs.major.build/learn/connectors/resource-client Type-safe, zero-dependency client for accessing your Major connectors. The `@major-tech/resource-client` package provides a type-safe, zero-dependency way to interact with your Major connectors from your application code. ## Features * **Type-safe**: Full TypeScript support for all operations. * **Universal**: Works in Node.js, browser, and edge environments. * **Zero-dependency**: Lightweight and fast. ## Client Generation You typically do not need to instantiate clients manually. Major generates singleton instances for you, which are available at `src/clients/` (or `client/`). ### Using the CLI You can add connectors and generate clients using the Major CLI. > [card] [Manage Connectors](/reference/cli/resource) > > Learn how to add and manage connectors using the `major resource` command. ### Using the Web Editor If you are developing in the Major Web Editor, the Major AI assistant will automatically add connectors and generate the necessary client code for you as you build your application. ## Per-connector usage Each connector type has a specific client class with a tailored `invoke` function signature. In the web editor, the Major AI assistant wires up the right client and its arguments as you build, and the generated client in `src/clients/` reflects the exact signature for your resource. > [card] [Connectors](/learn/connectors/overview) > > Browse all available connectors with setup and client documentation. > [!TIP] > > Need an endpoint the client doesn't cover, or want to use a third-party SDK on a connected account? Use [proxy fetch](/learn/connectors/proxy-fetch). ## Error Handling There are two types of errors you may encounter when using the Resource Client: 1. **Client Invocation Errors**: These occur when the client fails to communicate with the Major platform (e.g., network issues, protocol errors, authentication failures). These are thrown as `ResourceInvokeError` exceptions. 2. **API/Resource Errors**: These occur when the client successfully communicates with Major, but the underlying resource returns an error (e.g., database query failed, 404 Not Found from an API). These are returned as a successful response with `ok: false`. ### Handling Strategy You should wrap your `invoke` calls in a `try/catch` block to handle `ResourceInvokeError`, and check the `.ok` property of the result to handle resource errors. ```typescript theme={null} import { ResourceInvokeError } from "@major-tech/resource-client"; try { const result = await client.invoke(...); if (!result.ok) { // Handle Resource Error (e.g. database query failed) console.error("Resource Error:", result.error.message); // result.error structure: // { // message: string; // httpStatus?: number; // } return; } // Success! console.log(result.result); } catch (e) { if (e instanceof ResourceInvokeError) { // Handle Client Invocation Error (e.g. network failed) console.error("Invocation Error:", e.message); console.error("Status:", e.httpStatus); console.error("Request ID:", e.requestId); } else { // Handle unexpected errors console.error("Unknown Error:", e); } } ``` > [!NOTE] > > In a deployed app, resource calls made while handling a request use a token that lasts 20 minutes from when the request reached the app. If a handler runs longer, for example a long cron job or a workflow `app_call`, its later resource calls fail with a 401 error that says the token expired. Each failure is also logged to the app's [Errors](/learn/apps/errors) panel. Finish resource work within 20 minutes, or save progress and pick it up on the next run. ### Error Response Structure When `result.ok` is `false`, the response follows this structure: ```typescript theme={null} interface InvokeFailure { ok: false; requestId: string; error: { message: string; // Description of the error httpStatus?: number; // HTTP status code from the resource (if applicable) }; } ``` # Overview Source: https://docs.major.build/learn/skills/overview Reusable instruction bundles that extend what your agents can do. Skills are reusable bundles of instructions, reference material, and scripts that you attach to agents. Instead of duplicating the same guidance across every agent's system prompt, you author a skill once and attach it wherever it's needed. Skills follow Anthropic's [Agent Skills](https://www.anthropic.com/news/skills) convention. ## What's in a skill A skill is a versioned bundle of files: ```text theme={null} SKILL.md required - frontmatter (name, description) and instructions references/*.md optional - longer reference material the agent reads on demand scripts/*.ts optional - scripts the agent runs, e.g. to call a connector package.json scaffolded for you; add dependencies here if scripts need them ``` When an agent with an attached skill runs, it sees each skill's `description` and loads `SKILL.md` only when the task calls for it. It reads references or runs scripts only when it needs them, so attaching a skill doesn't bloat every prompt. > [!TIP] > > The `description` decides when an agent loads the skill. Say what it does, when to use it, and the phrases users might say. For example: "Fetches and summarises Stripe charges and refunds. Use when the user asks to summarise charges, look up a refund, or mentions a Stripe customer id." ### Scripts Scripts do real work, such as querying a connector. `@major-tech/resource-client` is preinstalled, so a script can call any connector the agent has access to without handling credentials (see [Resource client](/learn/connectors/resource-client)). A script prints one JSON line to stdout, `{"ok": true, ...}` or `{"ok": false, "error": "..."}`, and exits non-zero on failure. ## Building a skill Describe the skill to the [Platform Agent](/build/platform-agent) or any client connected through [MCP](/build/mcp), and it writes the bundle on the skill's sandbox, where scripts can be tested before saving. You can also edit the files yourself with the [CLI](/reference/cli/skill). ## Attaching skills to an agent In the agent builder, attach or detach skills from your agent. Major suggests skills and the connectors they recommend based on what your agent does. A single skill can be attached to many agents, and updating the skill updates the behavior everywhere it's used. ## Versioning Skills are versioned, with two separate steps: * **Save** writes the bundle as a new immutable version. Attached agents don't see it yet. * **Publish** points the skill at its latest saved version. Attached agents load the published version from their next run. You can roll back by publishing an earlier version. ## Access Skills use three roles (**User**, **Editor**, **Admin**) so authoring can be separated from use, and deletion is blocked while a skill is still attached to an agent. See [Access & Permissions](/learn/agents/access#skills) for the full breakdown. ## Activity Skill usage is logged: when a version is published, when a skill is attached or detached from an agent, and when an agent loads a skill or runs one of its scripts at runtime. This gives you an audit trail of how each skill is being used. # App triggers Source: https://docs.major.build/learn/triggers/app-triggers Let your deployed apps start and manage agent runs. Your Major [apps](/learn/apps/overview) can start [agent](/learn/agents/overview) runs from their server code and interact with those runs: read their messages, send follow-ups, stop them, and answer their tool approvals. A common pattern is a dashboard that, on load, starts a few agents (summarize my inbox, prep my calendar, review open PRs) and shows their results as they come in. App triggers start agents, not workflows. To start a [workflow](/learn/workflows/overview) from your own code, call its [webhook](/learn/triggers/webhooks). ## Example requests * "When the dashboard loads, have the inbox agent summarize today's unread email and show the result." * "Add a Research button to each account row that starts the account-research agent on that company." * "Show the agent's pending approvals in the app so users can approve them without leaving the page." ## Triggering from code Add the agent to your app to get a generated client, then call it from server code: ```typescript theme={null} import { supportBotClient } from "./clients"; const { runId } = await supportBotClient.run({ prompt: "Summarize today's unread email and flag what needs a reply.", }); const page = await supportBotClient.getAgentContent(runId, { limit: 20 }); ``` Runs are asynchronous: `run()` returns right away and you poll for messages. The client can also send follow-ups, stop runs, and answer tool approvals. See [Agents client](/learn/apps/agents-client) for setup and the full API. ## Who the run acts as When a signed-in user triggers the run through your app, the run is attributed to that user, and agents with per-user connectors act with that user's credentials. A call made outside a user's request runs as the person who deployed the app. A call made for an anonymous visitor, such as on a public page, is rejected because there's no user to attribute the run to. In every case, the deployer must have access to use the agent. ## Next steps > [card] [Agents client](/learn/apps/agents-client) > > Setup, methods, approvals, and errors. > [card] [Webhooks](/learn/triggers/webhooks) > > Start a workflow from your app or backend. > [card] [Tool permissions](/learn/agents/tool-permissions) > > Decide which tools need approval. # Connector events Source: https://docs.major.build/learn/triggers/connector-events Start a workflow when something happens in a connected service, like a Slack message or a Stripe payment. A connector event trigger starts a [workflow](/learn/workflows/overview) when one of your [connectors](/learn/connectors/overview) reports an event: a message posted in Slack, a payment succeeding in Stripe, an issue opened on GitHub. You choose the events, optionally filter them, and decide which parts of the event become the workflow's input. ## Example requests * "When someone posts a top-level message in #support, run the triage workflow with the message text and author." * "When a Stripe payment of \$100 or more succeeds, start the thank-you workflow." * "When an issue is opened in our main repo, have the triage agent label it." * "Whenever the Major app is mentioned in Slack, run the Q\&A workflow." ## Supported connectors Events are available for Slack, Stripe, GitHub, Gmail, Outlook Mail, Outlook Calendar, Google Calendar, Google Drive, Attio, and Linear, as well as many other connectors from the [connector catalog](/reference/connectors). For example: | Connector | Example events | | - | - | | Slack | `message`, `app_mention`, `block_actions`, `view_submission` | | Slack (Personal) | `message` in any channel, private channel, DM, or group DM the connected user is in | | Stripe | `payment_intent.succeeded`, `checkout.session.completed`, `invoice.payment_failed`, `customer.subscription.deleted` | | GitHub | `issues.opened`, `pull_request.opened`, `push`, `release.published` | | Google Calendar | Event changed (created, edited, or cancelled) on one calendar | | Outlook Calendar | `event.changed` (created, updated, or deleted) on one calendar | | Google Drive | File changed | | Linear | `issue.create`, `issue.update`, `comment.create`, `project_update.create`, `cycle.remove` | The connector must already be connected and configured in your organization. Ask the [Platform Agent](/build/platform-agent) which events a connector supports and what their payloads contain; it looks them up rather than guessing. ### Linear Linear events are named `.`, where the action is `create`, `update`, or `remove`. The resources are `issue`, `comment`, `issue_label`, `reaction`, `project`, `project_update`, `cycle`, `document`, `initiative`, `initiative_update`, `customer`, and `customer_need`. * Linear only lets workspace admins create webhooks. Set the Linear connector's permissions to **Admin** and connect it as a Linear workspace admin. Publishing fails on a connector set to **Read Only** or **Read & Write**, or one connected by someone who isn't a workspace admin. * On a per-user Linear connector, the person who publishes the workflow must be a workspace admin who connected with **Admin** permissions. * The trigger covers every public team in the workspace. Events from private teams aren't delivered. ### GitHub with your own GitHub App or GitHub Enterprise GitHub connectors that use Major's managed GitHub App need no setup for triggers. If the connector uses your own GitHub App, which every GitHub Enterprise connector does, set up the App's webhook before you publish a workflow with a GitHub trigger: 1. Open the GitHub connector's settings in Major and find the **Triggers** section. It shows the connector's webhook URL. 2. In your GitHub App's settings, under **Webhook**, check **Active** and set **Webhook URL** to that URL. 3. Set a webhook secret in GitHub, then paste the same secret into the **Triggers** section in Major and save. 4. In the GitHub App, select the event types that can trigger Major workflows. Major only accepts deliveries signed with the connector's own secret. If no secret is saved, publishing a workflow with a GitHub trigger on that connector fails. Triggers always use the secret from your organization's default environment. > [!NOTE] > > If the secret in GitHub doesn't match the one saved in Major, deliveries are dropped without an error, so GitHub's **Recent Deliveries** still shows them as successful. If a trigger never fires, check the secret first. ## How a connector event trigger is defined ```jsonc theme={null} "triggers": [ { "id": "support_message", "type": "connector-event", "label": "New message in #support", "config": { "connector_type": "slack", "resource_id": "5b7e1c2a-9d3f-4e8b-a1c6-2f4d6e8a0b1c", "options": { "events": ["message"], "filter": "event.json.channel == 'C0123456789' && !('thread_ts' in event.json) && !('subtype' in event.json)" } }, "input": { "text": { "$expr": "event.json.text" }, "user": { "$expr": "event.json.user" }, "ts": { "$expr": "event.json.ts" } } } ] ``` | Field | Required | Description | | - | - | - | | `config.connector_type` | Yes | The connector, such as `slack`, `stripe`, or `github`. | | `config.resource_id` | Yes | The id of the connected resource to listen to. If you have two Stripe accounts connected, this picks which one. | | `config.options.events` | Yes | One or more event types, with no duplicates. | | `config.options.filter` | No | A CEL expression. Only events for which it's true start a run. | | `config.options.includeAppMessages` | No | Slack (Personal) only. Include messages posted by apps and bots, which are excluded by default. In the editor this is **Include app messages**. | | `config.options.includeBotMessages` | No | Slack only. Include messages from bots and apps, which are excluded by default. | | `config.options.calendarId` | No | Google Calendar and Outlook Calendar only. The calendar to watch. For Google Calendar, `primary` or a calendar id. For Outlook Calendar, a calendar id; leave it out to watch the account's default calendar. | | `input` | No | A projection that picks or reshapes the event into the workflow's input. | In the workflow editor, add a trigger, choose **Connector event**, pick the connected connector, and select events from the list. Some catalog connectors take one event per trigger and show extra **Event options** for it. For Outlook Calendar, a **Calendar** dropdown lists the account's calendars; leave it on **Default calendar** to follow the account's default. Outlook Calendar event payloads include `changeType` (`created`, `updated`, or `deleted`) and `calendarId`. A deleted event can no longer be read from Microsoft, so its payload has only `id`, `changeType`, and `calendarId`. ## The event object The filter and the input projection both see a single `event` object: | Field | Description | | - | - | | `event.id` | The event's id. | | `event.type` | The event type, such as `message` or `payment_intent.succeeded`. Useful when a trigger subscribes to several events. | | `event.occurred_at` | When the event happened, if the connector reports it. | | `event.json` | The normalized event payload. For Slack, the message; for Stripe, the object the event is about (the PaymentIntent, the invoice, and so on). | The filter and projection can't see workflow nodes or `trigger`, because they run before the workflow starts. ## Filtering events Put every deterministic condition, such as channel, amount, repository, or subtype, in `options.filter` instead of starting a run for every event and having an agent ignore the ones you don't want. Events that don't match never start a run. The filter is a boolean [CEL](https://cel.dev) expression. Guard optional fields with `in` or `has()` before reading them. ```jsonc theme={null} // Slack: top-level messages in one channel, skipping edits, joins, and other subtypes "filter": "event.json.channel == 'C0123456789' && !('thread_ts' in event.json) && !('subtype' in event.json)" // Stripe: successful USD payments of at least $100 (amounts are in cents) "filter": "event.json.amount >= 10000 && event.json.currency == 'usd'" // GitHub: issues opened in one repository "filter": "event.json.repository.full_name == 'acme/web'" // Several events on one trigger: every failed invoice, but only paid invoices of $500 or more "filter": "event.type == 'invoice.payment_failed' || (event.type == 'invoice.paid' && event.json.amount_paid >= 50000)" ``` > [!WARNING] > > If you turn on **Include bot messages** for Slack, or **Include app messages** for Slack (Personal), a workflow that posts to the same channel can trigger itself. Use a narrow filter that excludes the messages your workflow posts. ## Shaping the input By default, the whole `event.json` object becomes `trigger.input`, so a Slack message's fields are available as `trigger.input.text`, `trigger.input.channel`, and so on. Set `input` to pass only what the workflow needs, or to rename fields. Each value is either a JSON literal or `{ "$expr": "..." }`: ```jsonc theme={null} "input": { "customer": { "$expr": "event.json.customer" }, "amount_usd": { "$expr": "double(event.json.amount) / 100.0" }, "event_type": { "$expr": "event.type" }, "source": "stripe" } ``` One `input` applies to every event the trigger subscribes to; there are no per-event overrides. `{{ }}` string interpolation isn't supported here, so use `$expr`. If the workflow has an `input_schema`, the projected input is validated against it. When a filter or projection fails to evaluate, or the input fails validation, the run is recorded as failed with the reason, and no nodes run. ## Per-user connectors Per-user connectors such as Gmail, Google Calendar, Outlook Mail, Outlook Calendar, and Slack (Personal) can back a connector event trigger on any workflow. The trigger watches the account of the person who published (deployed) the workflow, the same identity its runs act as. For example, a Gmail trigger watches the deployer's mailbox, and a Slack (Personal) trigger fires only for messages in conversations the deployer is in. When someone else takes over and republishes the workflow, the trigger moves to the new deployer's account. If the new deployer hasn't connected that account yet, the trigger shows an error in its settings until they sign in. ## Publishing Connector event subscriptions are created when you **publish** the workflow, and removed when a publish drops the trigger. Until then the trigger is inert. Use **Run now** with sample input to test the workflow first. Deleting a connector also tears down every connector event trigger that listens to it, and the trigger stops starting runs. Events that still arrive for a deleted connector are ignored. ## Next steps > [card] [Webhooks](/learn/triggers/webhooks) > > Start a workflow from your own systems with an authenticated call. > [card] [State and input](/learn/workflows/state) > > Use `trigger.input` in your nodes. # Overview Source: https://docs.major.build/learn/triggers/overview Every way work starts in Major: Run now, schedules, connector events, webhooks, and app triggers. A trigger is what starts a run. Most triggers start a [workflow](/learn/workflows/overview): you add them to the workflow's definition, and they fire on their own once the workflow is published. Apps can also start [agent](/learn/agents/overview) runs directly from their code. ## Example requests * "Run the weekly-report workflow every Monday at 8am Eastern." * "Start the triage workflow whenever someone posts a top-level message in #support." * "Kick off the onboarding workflow when a Stripe checkout session completes." * "Give our backend a URL it can call to start the refund review workflow." * "When the dashboard loads, have the inbox agent summarize today's unread email." ## Ways to start a run | Trigger | Starts | Fires when | Input | Set up in | | - | - | - | - | - | | **Run now** | Workflow | You click **Run now**, or ask the Platform Agent or an MCP client to run it | Values you enter | The workflow page, chat, or [MCP](/build/mcp) | | [Schedule](/learn/triggers/schedules) | Workflow | A cron expression matches, in a timezone | Literal values on the trigger | `cron` trigger in the definition | | [Connector event](/learn/triggers/connector-events) | Workflow | A connected service reports an event, such as a Slack message or a Stripe payment | The event payload, optionally filtered and reshaped | `connector-event` trigger in the definition | | [Webhook](/learn/triggers/webhooks) | Workflow | Something calls the trigger's URL with its bearer token | The JSON request body, optionally reshaped | `webhook` trigger in the definition | | [App trigger](/learn/triggers/app-triggers) | Agent | Your deployed app calls the agents client | The prompt your code sends | Your app's code | A workflow can have any number of triggers, of any mix of types. Each trigger has an `id`, a `type`, and an optional `label`: ```jsonc theme={null} "triggers": [ { "id": "weekday_morning", "type": "cron", "label": "Weekdays at 9am", "config": { "cron": "0 9 * * 1-5", "timezone": "America/New_York" } }, { "id": "backend_call", "type": "webhook", "label": "Called from our backend" } ] ``` ## Triggers only fire when published Saving a workflow never turns its triggers on. **Publish** is what makes them live: schedules start firing, connector event subscriptions are set up, and webhook URLs start accepting calls. A trigger in a saved but unpublished version is inert. This also means you can add a trigger and keep testing with **Run now**, which runs the latest saved version, before anything fires on its own. > [!NOTE] > > To pause a live workflow, remove its trigger (or comment it out in the JSONC), save, and publish. ## What a triggered run uses Triggered runs always run the **published** version and always call deployed apps. They run as the person who last published the workflow, so agents and app calls use that person's access. Each run appears in the workflow's run history, labeled with the trigger that started it. ## Next steps > [card] [Schedules](/learn/triggers/schedules) > > Run a workflow on a cron schedule. > [card] [Connector events](/learn/triggers/connector-events) > > Start a workflow from Slack, Stripe, GitHub, and more. > [card] [Webhooks](/learn/triggers/webhooks) > > Start a workflow with an authenticated HTTP call. > [card] [App triggers](/learn/triggers/app-triggers) > > Start agent runs from your deployed apps. # Schedules Source: https://docs.major.build/learn/triggers/schedules Run a workflow automatically on a recurring cron schedule. A schedule is a `cron` trigger on a [workflow](/learn/workflows/overview). It starts a run every time its cron expression matches, with no one needing to click anything. Use it for recurring work like a daily standup summary, a weekly report, or an hourly data check. To run an agent on a schedule, put it in a workflow with an `agent_call` node and give the workflow a `cron` trigger. ## Example requests * "Every weekday at 9am Eastern, have the standup agent summarize yesterday's commits and post them to #eng." * "Run the invoice-reconciliation workflow on the first of every month at 6am UTC." * "Check for stale support tickets every hour." ## How a schedule is defined ```jsonc theme={null} "triggers": [ { "id": "weekly_review", "type": "cron", "label": "Weekly review", "config": { "cron": "0 9 * * 1", "timezone": "America/New_York" }, "input": { "region": "EMEA", "lookback_days": 7 } } ] ``` | Field | Required | Description | | - | - | - | | `config.cron` | Yes | A five-field cron expression: minute, hour, day of month, month, day of week. `0 9 * * 1` is every Monday at 9:00. | | `config.timezone` | Yes | The IANA timezone the expression is evaluated in, such as `America/New_York` or `UTC`. | | `input` | No | Values passed to the run as `trigger.input`. They must be literals; `$state` and `$expr` aren't allowed here. | | `label` | No | The name shown on the trigger and in run history. | If the workflow has an `input_schema`, its defaults are filled in and the scheduled input is validated on every run. See [State and input](/learn/workflows/state#workflow-input). ## Building a schedule Tell the [Platform Agent](/build/platform-agent) what to run and how often. It turns a cadence like "every weekday at 9am ET" into `0 9 * * 1-5` in `America/New_York`, and asks for your timezone if it isn't clear. In the workflow editor, add a trigger and choose a schedule. You can type a cadence under **Describe it** and click **Generate**, or enter a **Cron expression** directly. The editor previews the upcoming run times. If the workflow has an `input_schema`, fill in the **Scheduled input** there too. > [!NOTE] > > A new or changed schedule starts firing only after you **publish** the workflow. Saving alone leaves it inert. Use **Run now** to test the workflow before you publish. ## Managing schedules * **Pause** a schedule by removing its trigger (or commenting it out), then saving and publishing. * **Change** the cadence or input by editing the trigger, then saving and publishing. * **Run now** starts a run immediately, outside the schedule, using the latest saved version. * **Run history** on the workflow lists every scheduled run with its per-node trace. Scheduled runs use the published version and run as the person who last published the workflow, so agents and app calls use that person's access. ## Approvals in unattended runs A scheduled run usually has no one watching it. If an agent in the workflow has tools set to **Ask** (see [Tool permissions](/learn/agents/tool-permissions)), set an `approval_channel` on its `agent_call` node to send those approval requests to a Slack channel. To have a person sign off on a step, add a `human_approval` node. See [Approvals in Slack](/learn/workflows/overview#approvals-in-slack). ## Next steps > [card] [Workflows](/learn/workflows/overview) > > Build the workflow a schedule runs. > [card] [Connector events](/learn/triggers/connector-events) > > Start a workflow when something happens instead of on a timer. # Webhooks Source: https://docs.major.build/learn/triggers/webhooks Start a workflow by calling its URL with a bearer token. A webhook trigger gives a [workflow](/learn/workflows/overview) its own URL. Any system that can send an HTTP request, such as your backend, a CI job, a form tool, or another SaaS product, can start the workflow by posting JSON to that URL with the trigger's bearer token. The request body becomes the workflow's input. > [!TIP] > > Webhook triggers are the secure, preferred way to let an outside system start work in Major. Every call must carry the trigger's credential, and calls without it are rejected. [Webhook routes](/learn/apps/webhook-routes) on an app are public and unauthenticated, so use them only when a service must post raw payloads to your app and can't send a credential. ## Example requests * "Give our backend a URL it can call with an order id to start the refund review workflow." * "Add a webhook trigger to the lead-routing workflow that takes an email and a company name." * "Let our CI pipeline start the release-notes workflow when a deploy finishes." ## How a webhook trigger is defined A webhook trigger has an `id`, the type `webhook`, and an optional `label` and `input`. It has no `config`, and its URL and credential never appear in the definition. ```jsonc theme={null} "triggers": [ { "id": "refund_request", "type": "webhook", "label": "Refund request" } ] ``` ## Getting the URL and credential Each webhook trigger has one URL and one bearer token. The token is shown **once**, so copy both into the system that will call the workflow, such as its secrets manager, before you close the dialog. **1. Add the trigger** In the workflow editor, add a trigger and choose **Webhook**. Major creates the URL right away and shows the URL and token. Copy both, confirm you've saved the token, and click **Done**. If the trigger was added in JSON, through the [Platform Agent](/build/platform-agent), [MCP](/build/mcp), or the [CLI](/reference/cli/workflow), its URL is created when you publish. Open the workflow in the editor afterwards and click **View credential** on the trigger to generate and reveal the token. **2. Publish** The URL doesn't accept calls until the workflow is **published**. Before that, calls are rejected. **3. Call the URL** Send a `POST` with the token in the `Authorization` header. Only people who can edit the workflow can view a credential. The token is never shown again, and Major never includes it in chat, MCP results, or the workflow file. If you lose it, remove the trigger, publish, and add it again. That creates a new URL and token. ## Calling the webhook ```bash theme={null} curl -X POST "https://go-api.prod.major.build/webhook-triggers//events" \ -H "Authorization: Bearer $MAJOR_WEBHOOK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "order_id": "ord_1042", "amount": 129.99 }' ``` * The body must be JSON, sent with `Content-Type: application/json`, and at most 1 MB. * A successful call returns `200` after the run has been created. * An unknown URL, a missing or wrong token, or an unpublished trigger all return `404`, so the response never reveals whether a trigger exists. * A body that isn't valid JSON returns `400`, and a body over 1 MB returns `413`. Use the exact URL shown in the editor. The `` in it is generated by Major and is not the trigger's `id` in the definition. Each call starts one run of the published version, which appears in the workflow's run history. ## Shaping the input By default, the JSON body becomes `trigger.input` as is, so the call above gives the workflow `trigger.input.order_id` and `trigger.input.amount`. The body must be a JSON object in this case. To pick or rename fields, set `input` on the trigger. Each value is a JSON literal or a `{ "$expr": "..." }` CEL expression, and expressions can only read the body, as `event.json`: ```jsonc theme={null} { "id": "new_lead", "type": "webhook", "label": "New lead from the CRM", "input": { "email": { "$expr": "event.json.contact.email" }, "company": { "$expr": "coalesce(event.json.contact.company, 'Unknown')" }, "source": "crm" } } ``` If the workflow has an `input_schema`, the input is validated against it. When the projection fails or the input doesn't validate, the call still returns `200`, and the run is recorded as failed with the reason. See [State and input](/learn/workflows/state#workflow-input). ## Removing a webhook Removing a published webhook trigger takes effect when you publish: the URL keeps working until then, and publishing retires it and revokes its token. Removing a trigger that was never published retires it immediately. The credential acts on behalf of the workflow's publisher at the time it was created. If that person loses access to the workflow or leaves the organization, calls are rejected. ## Next steps > [card] [Connector events](/learn/triggers/connector-events) > > Start a workflow from events in services you've connected. > [card] [State and input](/learn/workflows/state) > > Validate and use the webhook's input. # Web app Source: https://docs.major.build/learn/web-app Find your way around app.major.build: chat, apps, agents, workflows, connectors, and settings. The Major web app at [app.major.build](https://app.major.build) is where you chat with the [Platform Agent](/build/platform-agent), open and edit what you've built, and manage your organization. Everything you can do from [MCP](/build/mcp) or the [CLI](/build/cli) is also available here. ## Sidebar | Item | What it's for | | - | - | | **Build** | The home page. Start a chat with the Platform Agent to build an app, agent, skill, or workflow, or to ask a question about your data. Members without build access see **Chat** here instead. They can still start a chat with the Platform Agent to ask questions and use the apps and connectors shared with them, but it can't build or edit anything for them. | | **Apps** | Every app you can access. Open one to use it or edit it in the [editor](/learn/apps/editor). **Monitoring** under Apps shows runtime [errors](/learn/apps/errors) from deployed apps. | | **Agents** | The agent library. Open an agent to chat with it or edit it. **Skills** under Agents lists your [skills](/learn/skills/overview). | | **Workflows** | Your [workflows](/learn/workflows/overview), their triggers, and their run history. | | **Connectors** | The [connectors](/learn/connectors/overview) configured for your organization. | | **Analytics** | Organization usage dashboards (admins). The [audit log](/settings/audit-log) sits under it. Builders who aren't admins see **Audit log** on its own. | Items you don't have permission for are hidden. See [Members & roles](/settings/members-and-roles). ## Libraries The **Apps**, **Agents**, **Skills**, and **Workflows** pages each list every item you can access, with pinned items first. On **Apps**, the default sort is **Recently opened by you**: the apps you most recently opened or edited come first, and apps you've never opened come last. Use the sort menu to switch to another order, such as **Created at (newest first)**, **Most used (last 7 days)**, or **Name (A to Z)**. ## Chat Chat is the main way to work in Major. Describe what you want and the Platform Agent plans the work, asks for approval where needed, and builds it. See [Platform Agent](/build/platform-agent). * **Pinned and recent conversations** appear in the sidebar on the Build page. Pin a conversation to keep it at the top; **See all** opens the full list. * **Chat with an agent** by opening it from Agents, or by picking it when you start a chat. The chat runs with that agent's prompt, connectors, skills, and [tool permissions](/learn/agents/tool-permissions). * **Attachments and @ mentions** work in every chat. See [Editor](/learn/apps/editor#images-and-attachments). ## Search Open the command palette from the search button at the top of the sidebar to jump to any app, agent, workflow, or conversation. Search a workflow by name to open it, or search **Workflows** to open the Workflows page. ## Settings Open your account menu at the bottom of the sidebar to reach two areas: * **Account settings** - your profile, [connected accounts](/settings/connected-accounts), personal [tool permissions](/settings/tool-permissions), and the **Browser** tab with your [saved logins](/learn/agents/browser#saved-logins) and your own [browser controls](/settings/browser-controls#your-own-controls). * **Organization settings** - members, groups and invites, billing and usage, [referrals](/settings/billing#referrals), [environments](/learn/apps/environments), [domains](/learn/apps/domains), branding, [models](/settings/models), [browser controls](/settings/browser-controls), MCP, API tokens, and GitHub. The same menu switches between organizations if you belong to more than one. You can also create a new organization from it, unless your company's email domain already has an organization on Major. In that case, ask that organization's owner or an admin to invite you. See [Joining your company's organization](/settings/members-and-roles#joining-your-companys-organization). # Nodes Source: https://docs.major.build/learn/workflows/nodes Every workflow node type, its fields, and the rules a workflow graph must follow. A workflow's `nodes` are its steps and its `edges` connect them. Every node has an `id`, a `type`, a `config`, and an optional `label` that's shown in the graph. This page lists each node type's `config` fields. The authoritative definition is the JSON Schema at `https://api.prod.major.build/public/workflow.schema.json`. > [!TIP] > > Use underscores, not hyphens, in node ids. A hyphenated id can't be referenced from a `$expr` expression. ## agent_call Runs an [agent](/learn/agents/overview) with a prompt. | Field | Required | Description | | - | - | - | | `agent_id` | Yes | The agent to run. | | `prompt` | Yes | The instruction sent to the agent. Supports `{{ }}` interpolation. | | `output_schema` | No | A JSON Schema for the agent's answer. With it, the node's output has exactly that shape. Without it, the output is `{ "result": "" }`. | | `approval_channel` | No | `{ "type": "slack", "channel_id": "...", "channel_name": "..." }`. Sends the agent's [tool approval](/learn/agents/tool-permissions) requests to a Slack channel instead of the app. | ## app_call Calls an endpoint on one of your deployed [apps](/learn/apps/overview). | Field | Required | Description | | - | - | - | | `app_id` | Yes | The app to call. | | `method` | Yes | `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`. | | `path` | Yes | The endpoint path, for example `/api/orders`. | | `input` | No | An object of values. Sent as query parameters for `GET` and `DELETE`, and as a JSON body otherwise. | | `max_retries` | No | How many times to retry a failed response, from `0` to `10`. Defaults to no retries. | | `retry_on` | No | Which failed responses to retry: `4xx` (default) retries only 4xx responses, `any` retries any non-2xx response. | The node's output is the response body. A body that isn't a JSON object is wrapped as `{ "body": ... }`. Retries back off exponentially, starting at 2 seconds and capped at 30 seconds between attempts. A call where the app never answers isn't retried. In the editor, set **Max retries** and **Retry on** in the node inspector. In the workflow editor, pick the **Endpoint** from the endpoints Major extracted from the app's deployed API, or click **Enter manually** to type the method and path. If the endpoint's path has a parameter such as `{id}`, fill it in under **Path**. Edit `input` in the node's **Request body** field, or its **Query params** field for `GET` and `DELETE`. ## router Branches the run on state. | Field | Required | Description | | - | - | - | | `branches` | Yes | A list of `{ "when": { "$expr": "..." }, "to": ["node_id", ...], "label": "..." }`. | | `default` | Yes | Node ids to run when no branch matches. | | `default_label` | No | Label for the default path in the graph. | Branches are checked top to bottom and the first one whose `when` is true wins. A condition that evaluates to `null` doesn't match. Every target in the winning `to` list runs in parallel. The router must have exactly one outgoing edge per target named in its branches and default. ## for_each Runs a loop body once per item in a list. | Field | Required | Description | | - | - | - | | `input.iterable` | Yes | The list to loop over, usually a `$state` or `$expr` reference. | | `mode` | No | `sequential` (default) or `parallel`. | | `max_concurrency` | No | Upper bound on parallel iterations. | | `max_iterations` | No | Upper bound on the number of iterations. | | `collect_results` | No | Defaults to `true`. Set to `false` to skip collecting results. | A `for_each` has two outgoing edges: one with `"loop": "body"` into the loop body, and one with `"loop": "exit"` that runs after the last iteration. Every path from the body must lead back to the `for_each`. Loop bodies are the only cycles a workflow may have. Inside the body, `.item` and `.index` are the current item and its position. After the exit edge, `.results` holds each iteration's final output, in item order. ## join Waits for parallel branches to meet. | Field | Required | Description | | - | - | - | | `mode` | Yes | `all`. The join releases once every inbound edge has arrived. | Every edge into a join must come from the same fan-out (a `router` branch with several targets, for example), with no other join in between. Keep each parallel leg a simple line into the join. ## wait Pauses the run. | Field | Required | Description | | - | - | - | | `duration_seconds` | Yes | How long to wait, in seconds. | ## jev_noul, jev_choice, and jev_score Ask Jev (TypeSafe's judgment model) a question about some text, then branch on the answer with a `router`. Use them to filter, classify, or rate content. In the editor they're called **Jev yes/no**, **Jev choice**, and **Jev score**. All three take a `text` field: the text to judge. It supports `{{ }}` interpolation, so it's usually built from run state, for example `"{{trigger.input.email_body}}"`. ### jev_noul Asks one or more yes/no questions. | Field | Required | Description | | - | - | - | | `text` | Yes | The text to judge. | | `questions` | Yes | An object of `{ "": "" }`, with at least one entry. Question ids must be letters, digits, and underscores, and can't start with a digit. | The output is each question's yes-probability, from 0 to 1, under its id. For a node `judge` with a question `is_urgent`, branch with `judge.is_urgent > 0.5`. ### jev_choice Picks one label from a list of options. | Field | Required | Description | | - | - | - | | `text` | Yes | The text to judge. | | `question` | Yes | The question to answer, for example `"What is this email about?"`. | | `options` | Yes | An object of `{ "