Get started

  1. Install and setup the API
  2. Identify your portal URL
  3. Identify your workflow item ID
  4. Get an app ID
  5. Get an instance of a manager

1. Install and setup the API

The Workflow Manager JavaScript API is available as an ES module via npm, a JavaScript package manager. You can install the API locally for use with JavaScript frameworks such as React and Angular, and with module bundlers such as webpack or rollup.js.

To install:

Use dark colors for code blocksCopy
 
1
npm install @arcgis/workflow-manager

Then import modules:

Use dark colors for code blocksCopy
 
1
import { ManagerFactory } from '@arcgis/workflow-manager';

2. Identify your portal URL

This is the ArcGIS Portal instance that your Workflow Manager Server is federated with.

3. Identify your workflow item ID

Create a new or use an existing workflow item. Use the Workflow Manager Web Application to manage your workflow items.

Refer to Create and share workflow items for information on workflow items.

4. Get an app ID

You will need to provide an app ID for Workflow Manager to support OAuth2 authentication.

Complete the following steps to generate an app ID. This only needs to be done once per application.

  1. Login into the ArcGIS Portal associated with your Workflow Manager Server.
  2. Add a new application item. This new item can be a placeholder for your future web application. Refer to the ArcGIS Portal topic Add Items.
  3. On the item details page, copy the app ID under App Registration.

5. Get an instance of a manager

Get an instance of one of the managers provided by Workflow Manager.

Use the ManagerFactory as an entry point to instantiate one of the manager classes within Workflow Manager. There are managers to work on jobs, get configuration information, register for job notifications, and check server status.

Refer to Resources and Operations for the list of capabilities.

For example, to get an instance of a JobsManager:

Use dark colors for code blocksCopy
          
1
2
3
4
5
6
7
8
9
10
import { ConfigInfo, JobsManager, ManagerFactory } from '@arcgis/workflow-manager';

// Configure connection properties
const config: ConfigInfo = {
  portalUrl: 'https://domain.hostname.com/portal/',
  itemId: 'workflowItemId',
  appId: 'myAppId'
};

const jobsManager = await ManagerFactory.getManager(JobsManager, config);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.