Appearance
Phase
Workflow phase management: create, update and remove phases, field options, phase info, and following.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
phase.create | String processId, Object { name: String phaseName } | object |
phase.follow | processId, phaseId | boolean |
phase.remove | ObjectId, ObjectId | HailerResult |
phase.save_field_option | ObjectId, ObjectId, unknown, ObjectId | boolean |
phase.set_info | ObjectId, ObjectId, options, unknown | unknown |
phase.update | ObjectId, ObjectId, ProcessPhaseUpdate, unknown | boolean |
phase.create
Description
Create a new phase in the desired process or dataset. This function only creates a phase labeled "New Phase".
To modify name, fields, connections, and other settings use phase.update.
Parameters
Argument 1 (ObjectId, required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.create', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | |
followers | ObjectId[] | yes | |
name | string | yes | |
description | string | no | |
uid | ObjectId | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
members | object[] | no | |
fields | ObjectId[] | no | |
enableAnnouncement | boolean | no | |
announcementFields | ObjectId[] | no | |
announcementRecipients | string[] | no | |
announcementFieldsOrder | ObjectId[] | no | |
announcementToOwner | boolean | no | |
announcementToOwnerTeam | boolean | no | |
announcementAllowPrivateReply | boolean | no | Enables replying to feed announcements if true |
isEndpoint | boolean | no | |
isInitial | boolean | no | Allow activity creation. This is not enforced by the backend. |
possibleNextPhase | ObjectId[] | no | |
possibleNextPhaseSettings | Record<string, object> | no | |
fieldOptions | object | no | |
primaryNumericField | ObjectId | no | |
webhooksEnabled | boolean | no | |
webhookUrl | string | no | |
webhookAdded | boolean | no | |
webhookUpdated | boolean | no | |
primaryDateField | created | updated | completedOn | ObjectId | any | no | |
removed | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removedBy | ObjectId | no | |
color | string | no | |
key | string | no | Phase key |
ballAction | clear | fieldId | any | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
phase.follow
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (processId, required): workflowId
Argument 2 (phaseId, required): phaseId (phase in a Workflow)
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.follow', [
'507f1f77bcf86cd799439011', // processId (required)
'507f1f77bcf86cd799439011', // phaseId (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
phase.remove
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required):
Argument 2 (ObjectId, required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.remove', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
HailerResult
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
phase.save_field_option
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required):
Argument 2 (ObjectId, required):
Argument 3 (eventDateField` \| `tableDeadlineField, required): One of: eventDateField, tableDeadlineField.
Argument 4 (ObjectId, required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.save_field_option', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
'eventDateField', // argument 3 (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
phase.set_info
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required):
Argument 2 (ObjectId, required):
Argument 3 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
description | string | no | |
isEndpoint | boolean | no | |
name | string | no | |
possibleNextPhase | ObjectId[] | no | |
possibleNextPhaseSettings | object | no |
Argument 4 (fi` \| `en` \| `sv, optional): One of: fi, en, sv.
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.set_info', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
{
description: 'string',
isEndpoint: false,
},
'fi', // argument 4
]);
console.log(result);Returns
Undocumented
The return value is not described in the source yet.
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
phase.update
Description
When called, this function will attempt to update the specified phase according to the Phase Settings Object.
Will return an error if the user lacks the appropriate permissions.
Parameters
Argument 1 (ObjectId, required): Process Id
Argument 2 (ObjectId, required): Phase Id
Argument 3 (Phase Settings, required):
| Field | Type | Required | Description |
|---|---|---|---|
announcementFields | ObjectId[] | no | If a Feed post is generated, that post will contain info from these Fields from the associated Activity. |
announcementFieldsOrder | ObjectId[] | no | This array dictates the order in which the Feed post Fields will be displayed. It can differ from the Workflow order. |
announcementRecipients | string[] | no | |
announcementToOwner | boolean | no | |
announcementToOwnerTeam | boolean | no | |
announcementAllowPrivateReply | boolean | no | If true enables replies on Feed Announcement |
description | string | no | |
enableAnnouncement | boolean | no | If true will create a Feed post when an activity is moved into this Phase. |
fieldOptions | object | no | |
fields | ObjectId[] | no | Array of which Fields will be displayed in this Phase from all possible from the Workflow. |
followers | ObjectId[] | no | |
isEndpoint | boolean | no | If true will prevent Activities being moved to other Phases from this Phase. |
isInitial | boolean | no | If true will allow activities to be created. This is not enforced by the backend. |
name | string | no | Name of the Phase, can be any UTF-8 character. |
possibleNextPhase | ObjectId[] | no | Activities in this Phase can be moved to any Phase in this array. |
possibleNextPhaseSettings | Record<string, object> | no | |
primaryDateField | created | updated | completedOn | ObjectId | any | no | Date field to use as "deadline" indicator. |
primaryNumericField | ObjectId | no | Numeric field to form a cumulative count from for the entire Phase. |
webhooksEnabled | boolean | no | If true will attempt to send Activity information to the webhookUrl. |
webhookUrl | string | no | The URL to which Hailer will send activity information if webhhooksEnabled == true. |
webhookAdded | boolean | no | If true will send Activity information to the webhookUrl when Activities are moved into this Phase. |
webhookUpdated | boolean | no | If true will send Activity information to the webbhookUrl when Activities in this Phase are updated. |
color | string | no | |
key | string | no | Process key |
ballAction | clear | fieldId | any | no | Ball action on phase enter: null=nothing, "clear"=clear holder, fieldId=auto-assign from user field |
Argument 4 (fi` \| `en` \| `sv, optional): One of: fi, en, sv.
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('phase.update', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
{
announcementFields: ['507f1f77bcf86cd799439011'], // If a Feed post is generated, that post will contain info from these Fields from the associated Activity.
announcementFieldsOrder: ['507f1f77bcf86cd799439011'], // This array dictates the order in which the Feed post Fields will be displayed. It can differ from the Workflow order.
},
'fi', // argument 4
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.