# How to Create a Template

## 1. Before You Start: Pre-Template Checklist

* **✅ Check the connector’s authentication type**\
  Determine which authentication is required:
  * `OAuth 2.0`
  * `Session Auth`&#x20;
  * `API Key`&#x20;
  * `Basic Auth`
* **✅ Do you have a test account?**\
  It is **highly recommended** to use a **dedicated test account** with full API access during development.

## 2. Start Building the Template

### Select the Template Type

First, choose the type of integration:

* **Polling Template**: The system will fetch data at regular intervals. You can configure the **polling interval** (e.g., every 5 minutes, hourly).
* **Webhook Template**: The system will react to real-time events pushed from the source system.
  * There are two kinds of webhook setups:
    * **Basic Webhooks** – where the endpoint simply receives incoming events.
    * **Subscription Webhooks** – where the system must register a webhook URL via API.

Choosing the correct type depends on how the source system delivers or exposes data.

### Additional Settings

* **Collections**: Organize your templates into collections. These serve as categories to help your customers filter and browse templates more easily.
* **Groups**: Assign templates to user groups. Only users in the assigned group(s) will be able to see and use the template.

These settings help keep your integrations structured and access-controlled.

## 3. Configure the Trigger

Drag and drop the **Connector** into the Trigger field, then select the **endpoint** you want to use.\
Once selected, you'll see several additional settings—these are called **options**.

There are two types of options:

* **FlowMate Options**: Settings provided by FlowMate, such as the Array Splitting Key or Snapshot Key.
* **API Options**: Parameters specific to the API you’re connecting to, such as filters, query parameters, or required fields.

These options allow you to tailor the behavior of the integration and control what data is retrieved.

### **FlowMate Options**

<table><thead><tr><th width="239.7125244140625">Option</th><th>Description</th></tr></thead><tbody><tr><td>Array Splitting Key</td><td>Defines which array in the API response should be split into individual objects.</td></tr><tr><td>Snapshot Key</td><td>A timestamp field (e.g. <code>lastUpdated</code>) used to fetch only newly created or updated records.</td></tr><tr><td>Sync Param</td><td>Similar to Snapshot Key, but used when the API supports delta queries (returns only changed data).</td></tr><tr><td>Other Server</td><td>Allows using a server URL not listed in the API spec, useful when APIs have client-specific or external base URLs.</td></tr><tr><td>ID Linking</td><td>ID linking is used when it is important to work with IDs in further steps in the flows. In this way, IDs can be saved and accessed in further steps.</td></tr><tr><td>Skip Import</td><td>Depending on the use case, it is important to import existing data or prevent the initial import. For example, it makes sense to prevent the initial import if you want to offer a Slack or Teams integration. By default, the integration always performs an initial import.</td></tr><tr><td>Continue on Error</td><td>If an error occurs in the execution of a flow in a step, the next steps for this data set are not carried out. Sometimes, however, it is necessary to continue with the steps despite the error. This may be the case, for example, if you are looking for an ID in the second step of the flow. If the ID already exists, a certain step is executed. If the ID does not exist, an error is issued, but the flow can continue and execute another step. A very common use case is, for example, the creation or updating of contacts or calendar entries.</td></tr><tr><td>Passthrough</td><td>Passthrough ensures that you can access the data for all steps in flows with multiple actions. Passthrough is deactivated by default.</td></tr></tbody></table>

### Trigger Params

API Query Parameters are optional key-value pairs added to the URL to filter, sort, or control the response of an API call. They're typically used for:

* **Filtering**: e.g. `?status=active`
* **Pagination**: e.g. `?page=2&limit=50`
* **Sorting**: e.g. `?sortBy=createdAt&order=desc`
* **Date ranges**: e.g. `?from=2024-01-01&to=2024-02-01`

These are specific to the endpoint and are used to filter or limit the API response. They help you control **what** data is returned and **how much** of it.

### Trigger Mapping

If you want to add additional options to the trigger, such as a dropdown the user can select from, you'll need **Trigger Mapping**.\
Check out the [Mapping](/flowmate-documentation/step-configuration-mapping.md) page to learn more about mappings and available mapper types.

***

## 4. Configure the Action

To set up the **Action**, drag the **Connector** into the Action field and select the **endpoint** you want to use for the action.\
Just like with the trigger, you can configure various **options**—both FlowMate-side and API-specific.

Once the action is selected, you can proceed with the **Data Mapping**, where you define how data from the trigger is mapped to the action.\
Learn more about that here:

{% content-ref url="/pages/XZPW6QuP22sCMg8HKJuJ" %}
[Step Configuration (Mapping)](/flowmate-documentation/step-configuration-mapping.md)
{% endcontent-ref %}

***

## 5. Useful Tips

### Node.js Component for Debugging

You can use the built-in Node.js component to:

* Test the trigger and inspect real-time returned data
* Output data structures using the default debug code

This helps identify how the trigger behaves and simplifies data mapping.


---

# 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://flowmate.gitbook.io/flowmate-documentation/templates/how-to-create-a-template.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.
