The Stages API gives the ability to fully configure each stage of a workflow template.
Retreive the list of stages.
const stages = await Xedi.Stages.list();
[{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002","name": "My first stage","workflow_id": "","document_type_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","workflow_type": "template","state": "pending","created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002","name": "My second stage","workflow_id": "","document_type_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","workflow_type": "template","state": "pending","created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}]
Retrieve a stage by Id.
Property | Type | Required | Example |
---|---|---|---|
id | Xuid | 'f188a18a-a0fe-11ea-afae-0242ac120002' |
const stage = await Xedi.Stages.get('f188a18a-a0fe-11ea-afae-0242ac120002');
{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002","name": "My first stage","workflow_id": "","document_type_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","workflow_type": "template","state": "pending","created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Create a new stage
Property | Type | Required | Example |
---|---|---|---|
name | string | Stage name | |
workflow_id | Xuid | cec6b1ae-a63b-11ea-ae1c-01009cb3fa40 | |
document_type_id | Xuid | cec6b1ae-a63b-11ea-ae1c-01009cb3fa40 todo change this for a document_type_id | |
workflow_type | enum | template | |
state | enum | pending |
const stage = await Xedi.Stages.create({name: 'new Stage',workflow_id: 'cec6b1ae-a63b-11ea-ae1c-01009cb3fa40',document_type_id: 'cec6b1ae-a63b-11ea-ae1c-01009cb3fa40',workflow_type: 'template',state: 'pending'});
{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002","name": "new Stage","workflow_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","document_type_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","workflow_type": "template","state": "pending","created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Update an existing stage.
Property | Type | Required | Example |
---|---|---|---|
name | string | Stage name | |
workflow_id | Xuid | cec6b1ae-a63b-11ea-ae1c-01009cb3fa40 | |
document_type_id | Xuid | cec6b1ae-a63b-11ea-ae1c-01009cb3fa40 todo change this for a document_type_id | |
workflow_type | enum | template | |
state | enum | pending |
const stage = await Xedi.Stages.update({_id: 'f188a18a-a0fe-11ea-afae-0242ac120002'name: 'Updated Stage',workflow_id: 'cec6b1ae-a63b-11ea-ae1c-01009cb3fa40',document_type_id: 'cec6b1ae-a63b-11ea-ae1c-01009cb3fa40',workflow_type: 'template',state: 'pending'});
{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002","name": "Updated Stage","workflow_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","document_type_id": "cec6b1ae-a63b-11ea-ae1c-01009cb3fa40","workflow_type": "template","state": "pending","created_at": "2020-05-11 10:27:03","updated_at": "2020-05-11 10:27:03"}
Delete a stage.
Property | Type | Required | Example |
---|---|---|---|
id | Xuid | 'f188a18a-a0fe-11ea-afae-0242ac120002' |
const stage = await Xedi.Stages.delete('f188a18a-a0fe-11ea-afae-0242ac120002');
{"_id": "f188a18a-a0fe-11ea-afae-0242ac120002"}