Skip to content

Phase

Workflow phase management: create, update and remove phases, field options, phase info, and following.

Endpoints

EndpointArgumentsReturns
phase.createString processId, Object { name: String phaseName }object
phase.followprocessId, phaseIdboolean
phase.removeObjectId, ObjectIdHailerResult
phase.save_field_optionObjectId, ObjectId, unknown, ObjectIdboolean
phase.set_infoObjectId, ObjectId, options, unknownunknown
phase.updateObjectId, ObjectId, ProcessPhaseUpdate, unknownboolean

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

FieldTypeRequiredDescription
_idObjectIdyes
followersObjectId[]yes
namestringyes
descriptionstringno
uidObjectIdno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
membersobject[]no
fieldsObjectId[]no
enableAnnouncementbooleanno
announcementFieldsObjectId[]no
announcementRecipientsstring[]no
announcementFieldsOrderObjectId[]no
announcementToOwnerbooleanno
announcementToOwnerTeambooleanno
announcementAllowPrivateReplybooleannoEnables replying to feed announcements if true
isEndpointbooleanno
isInitialbooleannoAllow activity creation. This is not enforced by the backend.
possibleNextPhaseObjectId[]no
possibleNextPhaseSettingsRecord<string, object>no
fieldOptionsobjectno
primaryNumericFieldObjectIdno
webhooksEnabledbooleanno
webhookUrlstringno
webhookAddedbooleanno
webhookUpdatedbooleanno
primaryDateFieldcreated | updated | completedOn | ObjectId | anyno
removedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedByObjectIdno
colorstringno
keystringnoPhase key
ballActionclear | fieldId | anyno

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):

FieldTypeRequiredDescription
descriptionstringno
isEndpointbooleanno
namestringno
possibleNextPhaseObjectId[]no
possibleNextPhaseSettingsobjectno

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):

FieldTypeRequiredDescription
announcementFieldsObjectId[]noIf a Feed post is generated, that post will contain info from these Fields from the associated Activity.
announcementFieldsOrderObjectId[]noThis array dictates the order in which the Feed post Fields will be displayed. It can differ from the Workflow order.
announcementRecipientsstring[]no
announcementToOwnerbooleanno
announcementToOwnerTeambooleanno
announcementAllowPrivateReplybooleannoIf true enables replies on Feed Announcement
descriptionstringno
enableAnnouncementbooleannoIf true will create a Feed post when an activity is moved into this Phase.
fieldOptionsobjectno
fieldsObjectId[]noArray of which Fields will be displayed in this Phase from all possible from the Workflow.
followersObjectId[]no
isEndpointbooleannoIf true will prevent Activities being moved to other Phases from this Phase.
isInitialbooleannoIf true will allow activities to be created. This is not enforced by the backend.
namestringnoName of the Phase, can be any UTF-8 character.
possibleNextPhaseObjectId[]noActivities in this Phase can be moved to any Phase in this array.
possibleNextPhaseSettingsRecord<string, object>no
primaryDateFieldcreated | updated | completedOn | ObjectId | anynoDate field to use as "deadline" indicator.
primaryNumericFieldObjectIdnoNumeric field to form a cumulative count from for the entire Phase.
webhooksEnabledbooleannoIf true will attempt to send Activity information to the webhookUrl.
webhookUrlstringnoThe URL to which Hailer will send activity information if webhhooksEnabled == true.
webhookAddedbooleannoIf true will send Activity information to the webhookUrl when Activities are moved into this Phase.
webhookUpdatedbooleannoIf true will send Activity information to the webbhookUrl when Activities in this Phase are updated.
colorstringno
keystringnoProcess key
ballActionclear | fieldId | anynoBall 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? }.

Hailer Developer Documentation · v1.3.4