> ## Documentation Index
> Fetch the complete documentation index at: https://nango-scrips-ref.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Perform workflows with an API

> Step-by-step guide on how to perform workflows with an API (using an action template).

<Info>
  Pre-requisite: creation of an integration and at least one connection ([step-by-step guide](/integrate/guides/authorize-an-api)).
</Info>

# Activate an action template

Nango uses [actions](/understand/concepts/actions) to perform workflows involving external APIs. Workflows can involve arbitrary series of API requests & data transformations. For common use cases, [templates](/understand/concepts/templates) are available to let you get started fast.

Select your integration in the *Integrations* tab, and navigate to the *Scripts* tab. Available action templates will appear in the *Action Scripts* section. Select the relevant one and enable it with the toggle.

<Tip>
  Is there no template for your API? Or none matching your exact use case?

  Learn more about how to [build a custom integration](/customize/guides/create-a-custom-integration), [extend a template](/customize/guides/extend-an-integration-template) or [request custom integrations from Nango experts](/host/managed-integrations).
</Tip>

# Trigger an action

Actions can take inputs, and they return a result synchronously. Trigger actions using the backend SDK ([reference](/reference/sdks/node#trigger-an-action)) or API ([reference](/reference/api/action/trigger)):

<Tabs>
  <Tab title="cURL (standard endpoint)">
    ```bash
    curl --request POST \
      --url https://api.nango.dev/action/trigger \
      --header 'Authorization: Bearer <PROJECT-SECRET-KEY>' \
      --header 'Connection-Id: <string>' \
      --header 'Provider-Config-Key: <string>' \
      --data '{ "action_name": "<string>", "input": <json> }'
    ```
  </Tab>

  <Tab title="Node SDK">
    ```ts
    import { Nango }  from '@nangohq/node';

    const nango = new Nango({ secretKey: '<PROJECT-SECRET-KEY>' });

    const result = await nango.triggerAction('<INTEGRATION-ID>', '<CONNECTION-ID>', '<ACTION-NAME>', jsonInput);
    ```
  </Tab>
</Tabs>

<Tip>
  If you consume the API (vs. the SDK), you can use the standard endpoint (above) or a unique generated endpoint described in the *API Reference* tab of your integration in the Nango UI. The generated endpoint documents the specific parameters & responses of each action.
</Tip>

# Troubleshoot errors & monitor

Navigate to the *Activity* tab to inspect potential errors & monitor action executions.

<Tip>
  **Questions, problems, feedback?** Please reach out in the [Slack community](https://nango.dev/slack).
</Tip>
