# Inbound Sync branching

Inbound syncs tend to have much simpler configuration than outbound syncs. Because they are fetching data, typically there's not many settings to chose from which could affect the way each stream is retrieved. But in situations where you could make a change that alters the output data, branching will ensure that you can inspect it in a separate output table in Snowflake before merging.

Also, the Omnata UI allows you to choose which streams of an App are part of a sync. Changing this selection can also be done in a branch.

If your branch points to the same connection as main, and there are no branch-only configuration changes, it's assumed that the same source data is being fetched. The state of each stream will be carried to the branch and maintained there, so that any incremental streams continue from the same place without impact to the main sync.

If your branch points to a different connection to main, or there are branch-only configuration changes, it's assumed that different source data is being fetched. The state of each stream will be re-initialised the first time the branch is created, but will be remembered whenever a branch with the same name is reopened.

### Inbound Storage Location

When branching is enabled for inbound syncs, you need to differentiate the storage location so that different syncs/branches don't try to store their data in the same tables.

When setting a sync level storage location, you will need to either:

1. Include `{{branch_name}}` in one of the fields, or
2. Use Jinja conditional logic somewhere in the template, e.g:\\

   ```django
   {% if branch_name=='main' %}PRODUCTION{% else %}TEST{% endif %}
   ```

You can reach an example of inbound sync branching on [our blog](https://omnata.com/blog-detail/inbound-sync-branching-from-multiple-environments).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/branching/inbound-sync-branching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
