Appearance
Process (Workflow)
Workflow (process) management: creation, templates, fields, and document templates.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
process.create | { name: string, description: string } | unknown |
process.create_docTemplateField | options | unknown |
process.create_field | processId, ProcessFieldCreate | object |
process.delete_docTemplateField | options | unknown |
process.get_next_prefix_id | ObjectId | object |
process.install_template | templateId: string | HailerResult |
process.list | unknown, ObjectId | any[] |
process.list_templates | - | object[] |
process.remove | ObjectId | boolean |
process.remove_field | processId, fieldId | boolean |
process.set_docTemplateFieldProperty | options | unknown |
process.set_docTemplatePrintName | ObjectId, ObjectId, unknown | unknown |
process.set_documentTemplate | ObjectId, Object containing one document template. If it only contains the name, template will be deleted. | unknown |
process.set_documentTemplates | ObjectId, Object containing all document templates. If NULL, all templates will be deleted. | unknown |
process.set_info | ObjectId, ProcessUpdate, unknown | boolean |
process.update_field | processId, fieldId, ProcessFieldUpdate, unknown | boolean |
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):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | |
description | string | no | |
defaultView | string | no | |
workspaceId | WorkspaceId | no | Create in workspace, if not given the current workspace will be used. |
enableMapLocation | boolean | no | |
enableUnlinkedMode | boolean | no | Mark as dataset/database |
enableUniqueName | boolean | no | |
defaultGroupByField | string | no |
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):
| Field | Type | Required | Description |
|---|---|---|---|
processId | ObjectId | yes | Process Id |
name | string | yes | Template name |
group | images | activityLinks | fields | yes | Group 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):
| Field | Type | Required | Description |
|---|---|---|---|
editable | boolean | no | Enables editing for function fields |
placeholder | string | no | Placeholder text for label |
description | string | no | Description text for field |
data | ObjectId | string[] | no | List of allowable values for predefined options or process ids for linked activities |
unit | string | no | Unit - default to null (no unit) |
defaultTo | boolean | no | Enable default to given value in defaultValue |
defaultValue | string | no | Default value for field if defaultTo is enabled |
function | string | no | Javascript function code |
functionEnabled | boolean | no | Enable function |
functionVariables | Record<string, object | object[]> | no | |
reminderEnabled | boolean | no | Enable reminder |
modifier | object | no | field type modifiers |
key | string | no | Field Key |
reminderSettings | object | no | |
collapsedByDefault | boolean | no | Hides fields under subheader if enabled |
label | string | yes | Field label |
required | boolean | no | Require field to be given - defaults to false Default: false. |
type | activitylink | country | date | daterange | datetime | datetimerange | numeric | numericunit | teams | text | textarea | textunit | textpredefinedoptions | time | timerange | users | linkedfrom | subheader | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader. |
inviteToDiscussionOnChange | boolean | no | Only 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
| Field | Type | Required | Description |
|---|---|---|---|
editable | boolean | no | Enables editing for function fields |
placeholder | string | no | Placeholder text for label |
description | string | no | Description text for field |
data | ObjectId | string[] | no | List of allowable values for predefined options or process ids for linked activities |
unit | string | no | Unit - default to null (no unit) |
defaultTo | boolean | no | Enable default to given value in defaultValue |
defaultValue | string | no | Default value for field if defaultTo is enabled |
function | string | no | Javascript function code |
functionEnabled | boolean | no | Enable function |
functionVariables | Record<string, object | object[]> | no | |
reminderEnabled | boolean | no | Enable reminder |
modifier | object | no | field type modifiers |
key | string | no | Field Key |
reminderSettings | object | no | |
collapsedByDefault | boolean | no | Hides fields under subheader if enabled |
label | string | yes | Field label |
required | boolean | no | Require field to be given - defaults to false Default: false. |
type | activitylink | country | date | daterange | datetime | datetimerange | numeric | numericunit | teams | text | textarea | textunit | textpredefinedoptions | time | timerange | users | linkedfrom | subheader | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader. |
inviteToDiscussionOnChange | boolean | no | Only used for User fields. If true the user will be added to the activity discussion if they are not already in it. Default: false. |
_id | ObjectId | yes | |
uid | ObjectId | yes | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (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):
| Field | Type | Required | Description |
|---|---|---|---|
processId | ObjectId | yes | Process Id |
name | string | yes | Template name |
group | images | activityLinks | fields | yes | Group inside template.fieldMap (images, activityLinks or fields |
key | string | yes | Key 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
| Field | Type | Required | Description |
|---|---|---|---|
latestSuffix | number | yes |
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:
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | |
title | string | yes | |
description | string | yes | |
schemas | any | yes |
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):
| Field | Type | Required | Description |
|---|---|---|---|
processId | ObjectId | yes | Process Id |
name | string | yes | Name of template |
group | fieldMap | images | activityLinks | fields | opts | yes | Group inside template where property belongs to |
key | string | yes | Key |
property | label | value | description | field | process | staticActivityIds | formatFieldValue | thousandSeparator | decimalSeparator | toFixedDigits | toFixedIds | linkedActivitiesFilteredPhases | yes | Property to update |
value | any | no | Value/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):
| Field | Type | Required | Description |
|---|---|---|---|
coverImage | ObjectId | no | |
createNewLabel | string | no | |
description | string | no | |
defaultView | string | no | |
translations | Record<fi | en | sv, object> | no | Schema for process translations |
enableAddedField | boolean | no | |
enableAttachments | boolean | no | |
enableLinkedAnnouncements | boolean | no | |
enableMapLocation | boolean | no | |
enableMessenger | boolean | no | |
allowGuests | boolean | no | |
enableGuestEditing | boolean | no | |
enableModifiedField | boolean | no | |
enableOwnerField | boolean | no | |
enableBallTracking | boolean | no | |
enableOwnerTeamField | boolean | no | |
ownerTeamFieldTitle | string | no | |
enablePredefinedName | boolean | no | |
enablePreselectedTeam | boolean | no | |
enableUniqueName | boolean | no | |
enableUnlinkedMode | boolean | no | |
fieldsOrder | ObjectId[] | no | |
initPhaseDescription | string | no | |
locationRequired | boolean | no | |
name | string | no | |
nameColumnText | string | no | |
nameFieldPlaceHolderText | string | no | |
nameFunctionEnabled | boolean | no | |
nameFunctionVariables | Record<string, object | object[]> | no | |
nameFunction | string | no | |
nameEditable | boolean | no | |
order | integer | no | |
members | object[] | no | |
personInCharge | ObjectId | no | |
personInChargeLabel | string | no | |
phases | object | no | |
phasesOrder | ObjectId[] | no | |
phasesRemoved | ObjectId[] | no | |
predefinedNamePrefix | string | no | |
preselectedTeam | object | no | |
tags | ObjectId[] | no | |
allowMultipleTags | boolean | no | |
allowCustomTags | boolean | no | |
requireFileTag | boolean | no | |
defaultGroupByField | ObjectId | no | |
color | string | no | |
createdActivities | number | no | |
discussionPermissions | array | no | |
inviteActivityCreator | boolean | no | |
groupNames | string[] | no | |
enableActivityTagging | boolean | no | |
activityTaggingPhaseIds | any | no | |
autoPickPreselectedTeam | boolean | no | Determines if the sidenav automatically picks a team if no preselected team are set |
key | string | no | Process 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):
| Field | Type | Required | Description |
|---|---|---|---|
label | string | no | Field label |
required | boolean | no | Require field to be given - defaults to false |
editable | boolean | no | Enables editing for function fields |
placeholder | string | no | Placeholder text for label |
description | string | no | Description text for field |
data | ObjectId | string[] | no | List of allowable values for predefined options or process ids for linked activities |
unit | string | no | Unit - default to null (no unit) |
defaultTo | boolean | no | Enable default to given value in defaultValue |
defaultValue | string | no | Default value for field if defaultTo is enabled |
function | string | no | Javascript function code |
functionEnabled | boolean | no | Enable function |
functionVariables | Record<string, object | object[]> | no | |
reminderEnabled | boolean | no | Enable reminder |
modifier | object | no | field type modifiers |
key | string | no | Field Key |
reminderSettings | object | no | |
inviteToDiscussionOnChange | boolean | no | Only used for User fields. If true the user will be added to the activity discussion if they are not already in it. |
collapsedByDefault | boolean | no | Hides 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? }.