Skip to main content
Every Logic service has its own set of branches. A branch is a version of that service’s code. You can try a change on a branch, review it in a pull request, and deploy it to an environment when you are ready. This page covers what is specific to services. The concepts are the same as for the Frontend, and the pages in Branching explain them once for both.
Code branches are not environments. A branch isolates the code of a service. An environment holds your data and configuration, and it is where deployed code runs.

Find the branch of a service

Open the service in Backend > Logic. Under the service header, above the tabs, you see:
  • The branch chip. It shows the branch you are on, with a lock when the branch is protected. Select it to switch branches, create one with New branch from branch, open Pull requests, or open Manage branches.
  • The branch count. For example “2 branches”. It opens Manage branches for the service.
  • An information icon. Its tooltip explains that Code, Functions, and History show what is on this branch, and that Deploy sends a commit from a branch to an environment.
  • The pull request count. For example “1 pull request”. It opens the pull requests of the service.
Code, Functions, and History show the branch you selected. Deploying is a separate step: you choose the branch, the commit, and the environment in the Deploy dialog. The chip appears for people who can view the code of the service. A Viewer does not see it.

Each service has its own branches

A service does not share anything with the Frontend or with other services. Each one has:
  • Its own branches. Creating a branch in one service does not create one in another service or in the Frontend.
  • Its own default branch. Changing it does not affect other services or the Frontend.
  • Its own protected branches and protection rules.
  • Its own pull requests.
Each part remembers the branch you selected for it. You can test a change on main in the Frontend and on fix-prices in one service at the same time. In a service, Manage branches is a page named Branches · Service, with Back to service at the top. It has the same table as the Frontend panel, with Branch, Last commit, Protection, and the row actions, and these settings:
  • Default branch: with Change, for Owners and Admins.
  • Who can publish, a project-wide setting.
  • Code review, a project-wide setting that controls whether Archie Reviewer reviews a pull request when it is opened.
For the details of each action, see Working with branches, Protected branches, and Pull requests. One difference to keep in mind: on a protected branch of a service, the Code tab is read-only. It says “This branch is protected, so its code is read-only. See the banner above.” A merge into a branch of a service moves code only. The merge dialog reminds you: “This does not deploy the service. Deploy from Deploy.”

Branches vs. environments

A branch holds the code of the service. An environment holds your data and configuration, and it is where deployed code runs. Your data does not belong to a branch:
  • Tables, rows, and schema live in environments. Every branch that is connected to an environment sees the same tables and the same rows.
  • Variables belong to the environment. The variables of an environment are shared by every service deployed there. See Environment variables.
When the chat changes a table from a branch other than the default, it asks you to confirm first, because the change applies to the data of the environment. See The chat and branches.

Deploy a service from a branch

A service is deployed from a branch and a commit to an environment. Nothing deploys on its own: not when you save, and not when you merge.
  1. Select Deploy in the service header. The Deploy service dialog opens: “Choose the code and the environment. Nothing deploys on its own.”
  2. Choose the Branch to deploy.
  3. Choose the Commit. It defaults to the latest commit of the branch, and the exact commit you choose is what Archie deploys.
  4. Choose the environment in To.
  5. Confirm with the deploy button.
The dialog helps you check the result before you confirm:
  • Environment today: shows what is live in that environment now.
  • It compares this deploy with the live one, for example “+2 commits over live” or “Same commit as live”.
  • It tells you that the deploy replaces what is live in the environment.
  • It lists the variables of the environment, with a link to view them.
  • If you are working in one environment but the deploy goes to another, it says “You’re on current, but this deploys to target.”
  • If a deploy is already running to that environment, it shows its progress.
If you deploy a branch that is not protected to the root environment, the dialog warns you and asks you to type the name of the environment to continue. An Owner can protect the branch to skip that step. Owners, Admins, and Editors can deploy a service. To follow a deploy and read its pipeline, see Deployments.

Each environment exposes its own services

You can deploy the same service to several environments, for example master and staging. Each environment exposes the services deployed to it in its own GraphQL API. When you deploy a service to staging, its operations become available in the staging GraphQL API. Until you deploy there, they do not exist in that environment, even if they work in another one. If an operation of a service works in one environment and is missing in another, check where you deployed the service. See GraphQL API Explorer.

Generate functions on a branch

When you generate a function with Generate with AI, Archie commits it to the branch the service is on. The sheet shows Commits to branch. If that branch is protected, the sheet shows the protected branch banner, and Archie does not generate anything. You see “branch is protected, so Archie can’t commit to it. Switch branch or create a new one, then generate again.” The same applies when you retry or continue a plan that already has a service. Archie continues on the branch selected for that service. If the branch is protected, the retry is blocked until you switch to an unprotected branch or create one. In the chat, a protected branch makes the chat stop before it writes and ask where to continue, with Create branch name and continue and Use another branch. The card names the service: “branch is protected, service name. Choose where to continue.”

Next steps