# When to use Rippling primitives

> Decide when to use a function, transformation, or workflow.

## Overview

Functions, transformations, and workflows each do different jobs:

-   Functions bring data in
-   Transformations shape data that is already in Rippling
-   Workflows trigger when something happens

While most custom solutions use more than one primitive, start with the type of task you need to accomplish and refer to the accompanying guide for implementation details.

* * *

## Choose the primitive

| Task | Primitive |
| --- | --- |
| Pull from an external API, run logic that SQL or a workflow step cannot, or respond to a button in a custom app | [Function](https://developer.rippling.com/documentation/rippling-platform/custom-solutions/rippling-primitives#function) |
| Join, clean, or aggregate data that is already in Rippling | [Transformation](https://developer.rippling.com/documentation/rippling-platform/custom-solutions/rippling-primitives#transformation) |
| Run when an event happens, on a schedule, or from an external webhook | [Workflow](https://developer.rippling.com/documentation/rippling-platform/custom-solutions/rippling-primitives#workflow) |

### Function

A [function](https://developer.rippling.com/documentation/rippling-platform/developer/functions/getting-started) is JavaScript that Rippling runs for you.

#### In a custom pipeline

Use a function stream in a [custom pipeline](https://developer.rippling.com/documentation/rippling-platform/pipelines/custom-pipeline-setup) when no-code is not enough (e.g., the response is nested, you need custom pagination/incremental filters/deletes, a parent call before a child call).

_Example:_

A source lists organizations, then repositories for each organization. The parent stream emits one feed per organization, and the child stream reads the organization `id` and returns repository records.

#### From a workflow or custom app

Use a function when a workflow action or a button in a custom app needs code (e.g., several Rippling API calls, a third-party API response).

_Example:_

A manager clicks **Calculate payout** in a custom app. The function reads that record, computes the amount, and writes it back. The custom app shows the function’s success or error message.

### Transformation

Use a [transformation](https://developer.rippling.com/documentation/rippling-platform/transformations/getting-started) when the data is already in Rippling and the task is a type of query (e.g., filtering rows, renaming fields, calculating a value, joining two objects).

_Example:_

A pipeline has already stored third-party time entries in a Rippling custom object. A transformation joins these time entry rows to employees based on email, and publishes a single object the other teams can report on.

### Workflow

Use a [workflow](https://developer.rippling.com/documentation/rippling-platform/developer/workflows/get-started) when an event should trigger because a record changed, a date arrived, a schedule fired, or an external system called a Rippling webhook. Workflows are not ideal to reshape large datasets or page through an external API.

_Example:_

A transformation publishes completed performance reviews. A workflow triggers when a review’s status becomes completed, which then notifies HR and assigns a follow-up task. The transformation owns the data shape, but the workflow owns the notification.

* * *

## See also

-   [Get started with Rippling custom solutions](https://developer.rippling.com/documentation/rippling-platform/custom-solutions/gettingstarted)
-   [Custom solution best practices](https://developer.rippling.com/documentation/rippling-platform/custom-solutions/best-practices)
-   [Get started with Transformations](https://developer.rippling.com/documentation/rippling-platform/transformations/getting-started)
-   [Get started with Functions](https://developer.rippling.com/documentation/rippling-platform/developer/functions/getting-started)
-   [Invoke Functions](https://developer.rippling.com/documentation/rippling-platform/developer/functions/invoking-functions)
-   [Set up a custom pipeline](https://developer.rippling.com/documentation/rippling-platform/pipelines/custom-pipeline-setup)
-   [Get started with Workflows](https://developer.rippling.com/documentation/rippling-platform/developer/workflows/get-started)

Source: https://developer.rippling.com/documentation/rippling-platform/custom-solutions/rippling-primitives

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
