> ## Documentation Index
> Fetch the complete documentation index at: https://docs.membrane.agency/llms.txt
> Use this file to discover all available pages before exploring further.

# Function Nodes

Function nodes perform operations on data, make API requests, or interact with external systems. They are the core building blocks for implementing integration logic in flows.

Many function nodes use [Function Types](/docs/references/functions) to implement their logic. The configuration and behavior is defined by the corresponding function type.

## Create Data Link

**Type:** `create-data-link`

Creates a [Data Link](/reference/workspace-elements/data-links) between an object in your app and an object in an external app.

```yaml theme={null}
createLink:
  type: create-data-link
  name: Link Contact
  config:
    dataLinkTable: contact-links
    internalId:
      $var: input.trigger.internalContactId
    externalId:
      $var: input.createRecord.id
    direction: both
```

**Configuration options:**

* **`dataLinkTable`** – The Data Link table to use (must be created first)
* **`internalId`** – ID of the object in your app
* **`externalId`** – ID of the object in the external app
* **`direction`** – Link direction: `export` (internal → external), `import` (external → internal), or `both`

If a link already exists, it will be updated.

**Output:**

Returns the created or updated data link:

```javascript theme={null}
{
  id: 'link-789',
  internalId: 'internal-contact-123',
  externalId: 'external-contact-456',
  direction: 'both'
}
```

<br />

## Find Data Link

**Type:** `find-data-link`

Finds a [Data Link](/reference/workspace-elements/data-links) to get the corresponding object ID on the opposite side.

```yaml theme={null}
findLink:
  type: find-data-link
  name: Find Linked Contact
  config:
    dataLinkTable: contact-links
    internalId:
      $var: input.trigger.internalContactId
```

**Configuration options:**

* **`dataLinkTable`** – The Data Link table to search
* **`internalId`** – ID to look up (can be internal or external depending on direction)

**Output:**

Returns the ID of the matching record on the opposite side, or null if no link is found:

```javascript theme={null}
{
  externalId: 'external-contact-456'
}
// or null if not found
```

<br />

## Delete Data Link

**Type:** `delete-data-link`

Deletes an existing [Data Link](/reference/workspace-elements/data-links).

```yaml theme={null}
deleteLink:
  type: delete-data-link
  name: Unlink Contact
  config:
    dataLinkTable: contact-links
    internalId:
      $var: input.trigger.internalContactId
```

**Configuration options:**

* **`dataLinkTable`** – The Data Link table containing the link
* **`internalId`** – ID of the linked object

**Output:**

Returns confirmation of deletion:

```javascript theme={null}
{
  success: true,
  deletedLinkId: 'link-789'
}
```

<br />

## HTTP Request Operations

These nodes make HTTP requests to APIs and external services.

| Node Type                     | Description                                      | Function Type                                                                                        |
| :---------------------------- | :----------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
| `api-request-to-external-app` | Make authenticated API requests to external apps | [API Request to External App](/docs/references/functions/function-types/api-request-to-external-app) |
| `api-request-to-your-app`     | Make API requests to your internal API           | [API Request to Your App](/docs/references/functions/function-types/api-request-to-your-app)         |
| `custom-http-request`         | Make arbitrary HTTP requests to any endpoint     | [HTTP Request](/docs/references/functions/function-types/http-request)                               |

<br />

## Code Execution

These nodes execute code and run predefined actions.

| Node Type        | Description                                  | Function Type                                                      |
| :--------------- | :------------------------------------------- | :----------------------------------------------------------------- |
| `run-javascript` | Execute custom JavaScript or TypeScript code | [JavaScript](/docs/references/functions/function-types/javascript) |
| `run-action`     | Execute a predefined action                  | [Run Action](/docs/references/functions/function-types/run-action) |

<br />

## Integration Specific Operation

**Type:** `integration-specific-operation`

Executes operations that are specific to a particular integration. These are pre-built operations provided by connectors.

```yaml theme={null}
specialOp:
  type: integration-specific-operation
  name: Send Email
  config:
    operationKey: send-email
    parameters:
      to:
        $var: input.findContact.fields.email
      subject: Welcome!
      body:
        $var: input.transform.emailBody
```

**Configuration options:**

* **`operationKey`** – Key of the integration-specific operation
* **`parameters`** – Parameters required by the operation

The available operations and their parameters depend on the specific connector being used. Refer to connector documentation for details.

**Output:**

Returns the result of the operation. Structure varies by operation:

```javascript theme={null}
{
  success: true,
  messageId: 'msg-123',
  // ... other operation-specific fields
}
```
