The current state of one piece of work an AI agent is carrying out, much as a Lead is the state of one profile's progress through a journey. The shape of the work comes from an AgentWorkflowDef, named by workflowName, belonging to the AgentDef named by agentDefName, and currentStep records which step of that definition the work has reached. Each row belongs to one account and has an owning profile, and sourceItem points at whatever the work is about, as a URI style string such as invoice:abc123. A workflow is finished when completedDate or cancelledDate is set; until then both are null.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| adminOrg | Organisation | The account this workflow belongs to. Every lookup is scoped to it. Never null, and lazily loaded. |
| agentDefName | String | Name of the AgentDef that owns the workflow definition driving this piece of work. Never null, and up to 100 characters. |
| cancelledDate | Date | Date and time the work was abandoned. Null unless it was cancelled. |
| completedDate | Date | Date and time the work finished successfully. Null while it is still running. |
| createdDate | Date | Date and time the workflow was started. Never null. |
| currentStep | String | Name of the step in the workflow definition that the work has reached. Up to 100 characters. |
| id | long | Database identifier for this workflow. |
| modifiedDate | Date | Date and time the workflow was last changed, for example when it moved to a new step. Never null. |
| owner | Profile | The profile the work is being done for or by. Never null, and lazily loaded. |
| sourceItem | String | Identifies whatever the work is about, in a URI style form of type and identifier, for example invoice:abc123 or cart:42. Up to 100 characters. |
| status | String | Free text status label for the work, up to 100 characters. The values are not constrained by the platform, so what they mean is up to whatever sets them. |
| workflowName | String | Name of the AgentWorkflowDef this row is an instance of, which defines the steps the work moves through. Never null, and up to 100 characters. |
Methods
getId() · setId(long id) · getAgentDefName() · setAgentDefName(String agentDefName) · getWorkflowName() · setWorkflowName(String workflowName) · getCurrentStep() · setCurrentStep(String currentStep) · getSourceItem() · setSourceItem(String sourceItem) · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getOwner() · setOwner(Profile owner) · getModifiedDate() · setModifiedDate(Date modifiedDate) · getCreatedDate() · setCreatedDate(Date createdDate) · getCompletedDate() · setCompletedDate(Date completedDate) · getCancelledDate() · setCancelledDate(Date cancelledDate) · getStatus() · setStatus(String status) · rowId()
getId()
Returns: long
Database identifier for this workflow.
setId(long id)
Returns: void
Sets the database identifier. Normally only assigned by the persistence layer.
| Parameter | Description |
|---|---|
id | the primary key to assign |
getAgentDefName()
Returns: String
Name of the AgentDef that owns the workflow definition driving this piece of work. Never null, and up to 100 characters.
setAgentDefName(String agentDefName)
Returns: void
Sets the name of the AgentDef driving this work. Required.
| Parameter | Description |
|---|---|
agentDefName | the agent definition's name |
getWorkflowName()
Returns: String
Name of the AgentWorkflowDef this row is an instance of, which defines the steps the work moves through. Never null, and up to 100 characters.
setWorkflowName(String workflowName)
Returns: void
Sets the name of the workflow definition this row is an instance of. Required.
| Parameter | Description |
|---|---|
workflowName | the workflow definition's name |
getCurrentStep()
Returns: String
Name of the step in the workflow definition that the work has reached. Up to 100 characters.
setCurrentStep(String currentStep)
Returns: void
Moves the work to a step of the workflow definition. Must match a step name in that definition.
| Parameter | Description |
|---|---|
currentStep | the step's name |
getSourceItem()
Returns: String
Identifies whatever the work is about, in a URI style form of type and identifier, for example invoice:abc123 or cart:42. Up to 100 characters.
setSourceItem(String sourceItem)
Returns: void
Sets the reference to whatever the work is about, in type and identifier form.
| Parameter | Description |
|---|---|
sourceItem | the source item reference |
getAdminOrg()
Returns: Organisation
The account this workflow belongs to. Every lookup is scoped to it. Never null, and lazily loaded.
setAdminOrg(Organisation adminOrg)
Returns: void
Sets the account this workflow belongs to. Required.
| Parameter | Description |
|---|---|
adminOrg | the admin organisation the workflow belongs to |
getOwner()
Returns: Profile
The profile the work is being done for or by. Never null, and lazily loaded.
setOwner(Profile owner)
Returns: void
Sets the profile the work belongs to. Required.
| Parameter | Description |
|---|---|
owner | the owning profile |
getModifiedDate()
Returns: Date
Date and time the workflow was last changed, for example when it moved to a new step. Never null.
setModifiedDate(Date modifiedDate)
Returns: void
Sets the date and time the workflow was last changed. Required, so update it whenever the row changes.
| Parameter | Description |
|---|---|
modifiedDate | the last modified date |
getCreatedDate()
Returns: Date
Date and time the workflow was started. Never null.
setCreatedDate(Date createdDate)
Returns: void
Sets the date and time the workflow was started. Required.
| Parameter | Description |
|---|---|
createdDate | the creation date |
getCompletedDate()
Returns: Date
Date and time the work finished successfully. Null while it is still running.
setCompletedDate(Date completedDate)
Returns: void
Marks the work as completed at the given date, or clears the completion by setting null.
| Parameter | Description |
|---|---|
completedDate | the completion date, or null to reopen the work |
getCancelledDate()
Returns: Date
Date and time the work was abandoned. Null unless it was cancelled.
setCancelledDate(Date cancelledDate)
Returns: void
Marks the work as cancelled at the given date, or clears the cancellation by setting null.
| Parameter | Description |
|---|---|
cancelledDate | the cancellation date, or null to reopen the work |
getStatus()
Returns: String
Free text status label for the work, up to 100 characters. The values are not constrained by the platform, so what they mean is up to whatever sets them.
setStatus(String status)
Returns: void
Sets the free text status label for the work.
| Parameter | Description |
|---|---|
status | the status label |
rowId()
Returns: Long
Row identifier used by the reporting layer, the same value as the primary key.