- Install and setup the API
- Identify your portal URL
- Identify your workflow item ID
- Get an app ID
- 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:
npm install @arcgis/workflow-manager
2. Identify your portal URL
For ArcGIS Enterprise, this is the ArcGIS Portal instance that your Workflow Manager Server is federated with:
https
This property does not need to be configured for ArcGIS Online. If the portal URL is not defined, ArcGIS Online is used by default.
3. Identify your workflow item ID
Create a new item or use an existing workflow item. Use the Workflow Manager Web Application to manage your workflow items.
Learn more about creating and sharing 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.
- Sign in to your ArcGIS Online organization or the ArcGIS Portal associated with your Workflow Manager Server.
- 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.
- 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:
import { ConfigInfo, JobsManager, ManagerFactory } from '@arcgis/workflow-manager';
// Configure connection properties
const config: ConfigInfo = {
portalUrl: 'https://domain.hostname.com/portal/', //For ArcGIS Enterprise environments only
itemId: 'workflowItemId',
appId: 'myAppId'
};
const jobsManager = await ManagerFactory.getManager(JobsManager, config);