# Quick Start Guide

In this quick start guide, you'll create a flow that listens for an incoming API request and sends a message to a Slack channel. By the end you will have a live, working automation running on Fastn.

### What you'll learn

* How to create a flow with an API request trigger
* How to add and configure your first connector step
* How to map incoming data to outgoing fields
* How to test and deploy your flow

**Estimated time:** 10 minutes

### Prerequisites

* A **Fastn account,** sign up at [fastn.ai](https://fastn.ai/) if you do not have one
* A **Slack workspace** where you can post messages (and permission to install apps)

### Step 1: Create a new flow

1. Click **Flows** in the left-hand menu.
2. Click **+ Create Flows** in the top-right corner.
3. Your new flow opens with a **New API Request** trigger already in place (labeled "Real Time").
4. Give your flow a descriptive name, such as `slacknotification`.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FCTf3T1QUPVVCr1BTreRb%2Fpart1.gif?alt=media&#x26;token=bac4c6ba-ebc6-43a8-9f84-17ab9eb6fd13" alt=""><figcaption></figcaption></figure>

### Step 2: Add a Slack connector

1. Click the **+** button below the trigger step on the canvas.
2. You see five tabs: **Trigger**, **Connection**, **AI**, **Transformation**, **Control**.
3. Click the **Connection** tab.
4. Click **Connector**.
5. Search for **Slack** and select it.
6. Ensure that you have authorized Slack for
7. Choose the **sendMessage** action.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FSYl4bGZ44pqCJsSGvOwE%2Fpart%202%20connectors.gif?alt=media&#x26;token=d4ec4c0c-022c-4d3c-8273-055ce031d558" alt=""><figcaption></figcaption></figure>

### Step 3: Connect your Slack account

1. In the Slack connector step, click **Connect**.
2. A Slack authorization window opens. Select the workspace you want to connect.
3. Review the permissions and click **Allow**.
4. Once connected, your Slack account appears in the connector step.
5. Additionally, you will see a new Slack app pop up in your workspace as shown below:

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FSXwli6UwvYyWiGV647x0%2Fslack%20app%20connector.png?alt=media&#x26;token=a73ed544-9800-477d-9cfe-fb193432690e" alt=""><figcaption></figcaption></figure>

> **Note:** Fastn manages OAuth tokens securely. Your application never sees raw Slack credentials.

### Step 4: Configure the Slack message

1. In the Slack connector step, fill in the required fields:

| Field        | Value                                                                      |
| ------------ | -------------------------------------------------------------------------- |
| `channel ID` | The Slack channel to post to, such as `#general`.                          |
| `text`       | The message body (you map this from the API request data in the next step) |

2. For the `channel` field, enter the name or ID of your target Slack channel which you can access from the your Slack channel details.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FKtYRjagvyq79ybMf9saZ%2Fslack%20channel%20id.png?alt=media&#x26;token=69e73a2e-a7e3-4f16-99c0-5df79f0a977a" alt=""><figcaption></figcaption></figure>

### Step 5: Map request data to the Slack message

This is where the flow connects input to output. You map data from the incoming API request to the Slack message text.

1. Click the `text` field in the Slack connector configuration.
2. Use the data mapper to reference the incoming request. For example:

```
New request received: {{input.message}}
```

3. This maps the `message` field from the incoming API request payload into the Slack message text.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FMxG3WiMJC9Py7zHJReUG%2Fdata%20mapping.png?alt=media&#x26;token=731adf81-c2e8-4362-ba84-130d1ea1d4e7" alt=""><figcaption></figcaption></figure>

### Step 6: Test your flow

1. Click the **Test** button in the top-right corner of the flow builder.
2. Enter test input in JSON format:

```json
{
  "message": "Hello from my first Fastn flow!"
}
```

3. Click **Run**.
4. Check your Slack channel — the message "New request received: Hello from my first Fastn flow!" should appear.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FwwKGV6s45w7lFf4OCIPD%2Ftest%20success.gif?alt=media&#x26;token=6e96b7f9-6da6-4ad9-9962-0ca1c5049a1f" alt=""><figcaption></figcaption></figure>

> If the test fails, check that your Slack account is connected and that the channel name is correct. The test console displays error details for each step.

### Step 7: Deploy your flow

1. Click the **Deploy** button in the top-right corner.
2. Confirm the deployment.
3. Your flow status changes to **Live**.

Your flow is now live and callable via API. You can find your API key in **Settings → API Keys** and include it as the `x-fastn-api-key` header in production requests.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fo1KkFuHfFTFmDCmgqUcr%2Fapi%20key.gif?alt=media&#x26;token=9b5e47e6-1d39-4157-9fbb-e8b6656994f2" alt=""><figcaption></figcaption></figure>

### Troubleshooting

| Problem                       | Solution                                                                                           |
| ----------------------------- | -------------------------------------------------------------------------------------------------- |
| Slack message does not appear | Check that your Slack account is connected and the channel name is correct                         |
| Test returns an error         | Check the error details in the test console. Most common cause is a misconfigured field            |
| Flow shows "Changes Pending"  | You have unsaved changes. Click **Save**, then **Deploy** again                                    |
| API request returns 401       | Include the `x-fastn-api-key` header with a valid API key. Generate one in **Settings → API Keys** |
