Setup Workflows

Setting up OneRecord Workflows

Setting up OneRecord Workflows for usage within an application requires a two part setup: Client Setup and Server Setup.

Client Setup

Installation (what is needed for the front-end application)

Step 1: Get an npm access token from OneRecord

In order to use Workflows, a project must be authorized to pull down the package from npm. This authorization comes in the form of an npm access token that companies can receive from OneRecord. This npm access token should be placed in an .npmrc file at the root of a project (as a sibling file of the package.json file).

The .npmrc file contents:

//registry.npmjs.org/:_authToken=SOME_NPM_ACCESS_TOKEN

You can then proceed to install the @onerecord/workflows package (see Step 2 below).

Step 2: Install the @onerecord/workflows package

Workflows can be installed using any package manager for the node environment (like npm, yarn, pnpm, etc).

Install with npm:
npm install @onerecord/workflows
Install with yarn:
yarn add @onerecord/workflows
Install with pnpm:
pnpm add @onerecord/workflows

Server Setup

Workflows use OneRecord API on your behalf but they still require authentication when using OneRecord API production or preproduction environments. Authentication is not required if using OneRecord API development or staging environments.

This requires you to have an API/Service Layer/some sort of back end that receives requests made by Workflows. Each Workflow request will have an Authorization header set. Your back end must check the Authorization header value against your own authentication system, and, if valid, forward the request to OneRecord API. This ensures that only users authenticated by your system can make requests to OneRecord API. Note that you must provide each Workflow with the Authorization header value (see the Workflow Reference Guides for details how)

In addition, your back end must be authenticated with OneRecord API itself.


What’s Next

Workflow Reference Guides