Skip to content

Process (Workflow)

Workflow (process) management: creation, templates, fields, and document templates.

Endpoints

EndpointArgumentsReturns
process.create{ name: string, description: string }unknown
process.create_docTemplateFieldoptionsunknown
process.create_fieldprocessId, ProcessFieldCreateobject
process.delete_docTemplateFieldoptionsunknown
process.get_next_prefix_idObjectIdobject
process.install_templatetemplateId: stringHailerResult
process.listunknown, ObjectIdany[]
process.list_templates-object[]
process.removeObjectIdboolean
process.remove_fieldprocessId, fieldIdboolean
process.set_docTemplateFieldPropertyoptionsunknown
process.set_docTemplatePrintNameObjectId, ObjectId, unknownunknown
process.set_documentTemplateObjectId, Object containing one document template. If it only contains the name, template will be deleted.unknown
process.set_documentTemplatesObjectId, Object containing all document templates. If NULL, all templates will be deleted.unknown
process.set_infoObjectId, ProcessUpdate, unknownboolean
process.update_fieldprocessId, fieldId, ProcessFieldUpdate, unknownboolean

process.create

Description

API endpoint for creating a workflow/dataset in Hailer. If you are able to, we strongly recommend using the web UI. The doc for this endpoint looks bad and is currently being refactored.

Parameters

Argument 1 (object, optional):

FieldTypeRequiredDescription
namestringno
descriptionstringno
defaultViewstringno
workspaceIdWorkspaceIdnoCreate in workspace, if not given the current workspace will be used.
enableMapLocationbooleanno
enableUnlinkedModebooleannoMark as dataset/database
enableUniqueNamebooleanno
defaultGroupByFieldstringno

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('process.create', [
  {
    name: 'string',
    description: 'string',
  },
]);
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? }.

process.create_docTemplateField

Description

Create field inside template.fieldMap under documentTemplates.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
processIdObjectIdyesProcess Id
namestringyesTemplate name
groupimages | activityLinks | fieldsyesGroup inside template.fieldMap (images, activityLinks or fields

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('process.create_docTemplateField', [
  {
    processId: '507f1f77bcf86cd799439011', // Process Id
    name: 'string', // Template name
    group: 'images', // Group inside template.fieldMap (images, activityLinks or fields
  },
]);
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? }.

process.create_field

Description

Calling this endpoint with the appropriate permissions and a correctly formatted fieldObject will add a new field to the selected workflow/dataset.

Example: If provided the field parameter object {"label": "Total cost", "type": "numericunit", "unit": "€"} this will create and return a field {"id": "0123456789abcdef12345678", "label": "Total cost", "type": "numericunit", "unit": "€"}

Parameters

Argument 1 (processId, required): workflowId

Argument 2 (Process Field descriptor, required):

FieldTypeRequiredDescription
editablebooleannoEnables editing for function fields
placeholderstringnoPlaceholder text for label
descriptionstringnoDescription text for field
dataObjectId | string[]noList of allowable values for predefined options or process ids for linked activities
unitstringnoUnit - default to null (no unit)
defaultTobooleannoEnable default to given value in defaultValue
defaultValuestringnoDefault value for field if defaultTo is enabled
functionstringnoJavascript function code
functionEnabledbooleannoEnable function
functionVariablesRecord<string, object | object[]>no
reminderEnabledbooleannoEnable reminder
modifierobjectnofield type modifiers
keystringnoField Key
reminderSettingsobjectno
collapsedByDefaultbooleannoHides fields under subheader if enabled
labelstringyesField label
requiredbooleannoRequire field to be given - defaults to false Default: false.
typeactivitylink | country | date | daterange | datetime | datetimerange | numeric | numericunit | teams | text | textarea | textunit | textpredefinedoptions | time | timerange | users | linkedfrom | subheaderyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
inviteToDiscussionOnChangebooleannoOnly used for User fields. If true the user will be added to the activity discussion if they are not already in it. Default: false.

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('process.create_field', [
  '507f1f77bcf86cd799439011', // processId (required)
  {
    label: 'string', // Field label
    type: 'activitylink',
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
editablebooleannoEnables editing for function fields
placeholderstringnoPlaceholder text for label
descriptionstringnoDescription text for field
dataObjectId | string[]noList of allowable values for predefined options or process ids for linked activities
unitstringnoUnit - default to null (no unit)
defaultTobooleannoEnable default to given value in defaultValue
defaultValuestringnoDefault value for field if defaultTo is enabled
functionstringnoJavascript function code
functionEnabledbooleannoEnable function
functionVariablesRecord<string, object | object[]>no
reminderEnabledbooleannoEnable reminder
modifierobjectnofield type modifiers
keystringnoField Key
reminderSettingsobjectno
collapsedByDefaultbooleannoHides fields under subheader if enabled
labelstringyesField label
requiredbooleannoRequire field to be given - defaults to false Default: false.
typeactivitylink | country | date | daterange | datetime | datetimerange | numeric | numericunit | teams | text | textarea | textunit | textpredefinedoptions | time | timerange | users | linkedfrom | subheaderyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
inviteToDiscussionOnChangebooleannoOnly used for User fields. If true the user will be added to the activity discussion if they are not already in it. Default: false.
_idObjectIdyes
uidObjectIdyes
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.delete_docTemplateField

Description

Delete field inside template.fieldMap under documentTemplates.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
processIdObjectIdyesProcess Id
namestringyesTemplate name
groupimages | activityLinks | fieldsyesGroup inside template.fieldMap (images, activityLinks or fields
keystringyesKey for field. e.g: field1, field2 or image1

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('process.delete_docTemplateField', [
  {
    processId: '507f1f77bcf86cd799439011', // Process Id
    name: 'string', // Template name
    group: 'images', // Group inside template.fieldMap (images, activityLinks or fields
    key: 'string', // Key for field. e.g: field1, field2 or image1
  },
]);
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? }.

process.get_next_prefix_id

Description

Undocumented

This endpoint has no description in the source yet.

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('process.get_next_prefix_id', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);

Returns

FieldTypeRequiredDescription
latestSuffixnumberyes

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.install_template

Description

Install template to current network

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('process.install_template', [
  '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? }.

process.list

Description

List workflow/dataset information. Can be used to determine required/non-required fields for a given phase, or if not supplied with a phaseId then it can be used to give insight into the entire workflow. Will only work for a workflow or dataset which the active user has access to.

Parameters

Argument 1 (processId \| string, optional): valid process id or key

Argument 2 (ObjectId, optional): phase id to filter by, or workspace id when resolving a process key

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('process.list', [
  '507f1f77bcf86cd799439011', // valid process id or key
  '507f1f77bcf86cd799439011', // ObjectId
]);
console.log(result);

Returns

Array of any.

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.list_templates

Description

List available templates

Parameters

Undocumented

This endpoint declares no argument schema in the source yet.

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('process.list_templates', []);
console.log(result);

Returns

Array of objects:

FieldTypeRequiredDescription
_idObjectIdyes
titlestringyes
descriptionstringyes
schemasanyyes

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.remove

Description

Standard function for removing a workflow or dataset, provided the user has the appropriate permissions.

Parameters

Argument 1 (ObjectId, required): Valid processId

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('process.remove', [
  '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? }.

process.remove_field

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (processId, required): workflowId

Argument 2 (fieldId, required): fieldId

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('process.remove_field', [
  '507f1f77bcf86cd799439011', // processId (required)
  '507f1f77bcf86cd799439011', // fieldId (required)
]);
console.log(result);

Returns

boolean

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.set_docTemplateFieldProperty

Description

Set field property for template under documentTemplates.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
processIdObjectIdyesProcess Id
namestringyesName of template
groupfieldMap | images | activityLinks | fields | optsyesGroup inside template where property belongs to
keystringyesKey
propertylabel | value | description | field | process | staticActivityIds | formatFieldValue | thousandSeparator | decimalSeparator | toFixedDigits | toFixedIds | linkedActivitiesFilteredPhasesyesProperty to update
valueanynoValue/data for property

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('process.set_docTemplateFieldProperty', [
  {
    processId: '507f1f77bcf86cd799439011', // Process Id
    name: 'string', // Name of template
    group: 'fieldMap', // Group inside template where property belongs to
    key: 'string', // Key
    property: 'label', // Property to update
  },
]);
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? }.

process.set_docTemplatePrintName

Description

Update documentTemplate print name.

Parameters

Argument 1 (ObjectId, required): ProcessId

Argument 2 (ObjectId, required): TemplateId

Argument 3 (string, required): Print name

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('process.set_docTemplatePrintName', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
  '507f1f77bcf86cd799439011', // ObjectId (required)
  'string', // Print name (required)
]);
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? }.

process.set_documentTemplate

Description

Create, update and remove one documentTemplate.

Parameters

Argument 1 (ObjectId, required): ProcessId

Argument 2 (object, required): Object containing one document template. If it only contains the name, template will be deleted.

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('process.set_documentTemplate', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
  { /* ... */ },
]);
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? }.

process.set_documentTemplates

Description

Create, update and remove documentTemplates.

Parameters

Argument 1 (ObjectId, required): ProcessId

Argument 2 (object, optional): Object containing all document templates. If NULL, all templates will be deleted.

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('process.set_documentTemplates', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
  { /* ... */ },
]);
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? }.

process.set_info

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (ObjectId, required):

Argument 2 (object, required):

FieldTypeRequiredDescription
coverImageObjectIdno
createNewLabelstringno
descriptionstringno
defaultViewstringno
translationsRecord<fi | en | sv, object>noSchema for process translations
enableAddedFieldbooleanno
enableAttachmentsbooleanno
enableLinkedAnnouncementsbooleanno
enableMapLocationbooleanno
enableMessengerbooleanno
allowGuestsbooleanno
enableGuestEditingbooleanno
enableModifiedFieldbooleanno
enableOwnerFieldbooleanno
enableBallTrackingbooleanno
enableOwnerTeamFieldbooleanno
ownerTeamFieldTitlestringno
enablePredefinedNamebooleanno
enablePreselectedTeambooleanno
enableUniqueNamebooleanno
enableUnlinkedModebooleanno
fieldsOrderObjectId[]no
initPhaseDescriptionstringno
locationRequiredbooleanno
namestringno
nameColumnTextstringno
nameFieldPlaceHolderTextstringno
nameFunctionEnabledbooleanno
nameFunctionVariablesRecord<string, object | object[]>no
nameFunctionstringno
nameEditablebooleanno
orderintegerno
membersobject[]no
personInChargeObjectIdno
personInChargeLabelstringno
phasesobjectno
phasesOrderObjectId[]no
phasesRemovedObjectId[]no
predefinedNamePrefixstringno
preselectedTeamobjectno
tagsObjectId[]no
allowMultipleTagsbooleanno
allowCustomTagsbooleanno
requireFileTagbooleanno
defaultGroupByFieldObjectIdno
colorstringno
createdActivitiesnumberno
discussionPermissionsarrayno
inviteActivityCreatorbooleanno
groupNamesstring[]no
enableActivityTaggingbooleanno
activityTaggingPhaseIdsanyno
autoPickPreselectedTeambooleannoDetermines if the sidenav automatically picks a team if no preselected team are set
keystringnoProcess key

Argument 3 (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('process.set_info', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
  {
    coverImage: '507f1f77bcf86cd799439011',
    createNewLabel: 'string',
  },
  'fi', // argument 3
]);
console.log(result);

Returns

boolean

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

process.update_field

Description

When called, will attempt to update the desired Field in the indicated Workflow (processId) according to the provided updateObject. The function will take all information given in the updateObject

If the user lacks the appropriate permissions, this call will fail. Similarly, if the fieldId and processId are mismatched, in that the field is not used in that workflow, it will return a failure response.

Parameters

Argument 1 (processId, required): workflowId

Argument 2 (fieldId, required): fieldId

Argument 3 (Process Field descriptor, required):

FieldTypeRequiredDescription
labelstringnoField label
requiredbooleannoRequire field to be given - defaults to false
editablebooleannoEnables editing for function fields
placeholderstringnoPlaceholder text for label
descriptionstringnoDescription text for field
dataObjectId | string[]noList of allowable values for predefined options or process ids for linked activities
unitstringnoUnit - default to null (no unit)
defaultTobooleannoEnable default to given value in defaultValue
defaultValuestringnoDefault value for field if defaultTo is enabled
functionstringnoJavascript function code
functionEnabledbooleannoEnable function
functionVariablesRecord<string, object | object[]>no
reminderEnabledbooleannoEnable reminder
modifierobjectnofield type modifiers
keystringnoField Key
reminderSettingsobjectno
inviteToDiscussionOnChangebooleannoOnly used for User fields. If true the user will be added to the activity discussion if they are not already in it.
collapsedByDefaultbooleannoHides fields under subheader if enabled

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('process.update_field', [
  '507f1f77bcf86cd799439011', // processId (required)
  '507f1f77bcf86cd799439011', // fieldId (required)
  {
    label: 'string', // Field label
    required: false, // Require field to be given - defaults to `false`
  },
  '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