Skip to content

XoneWork Comments

XoneWork Comments works with the comments of a XoneWork task: it reads the latest ones, writes a new one and changes or deletes the ones the account itself wrote. Use it so an agent can ask a question or report its progress on the task, and to read what people answered.

The component works as the person who owns the token of the credential: the comments it writes appear under their name.

When to use it

  • An agent leaves a question on the task when it is missing information and, on the next run, reads the answer.
  • Post the result of an automation, a summary or a link as a comment on a task.
  • Read the comments of a task to give them to an agent together with the note.

Configuration

You need a XoneWork credential with the address of your XoneWork and a personal API token. See Credentials.

  1. In XoneWork, open Account › API tokens and create a token. Choose its permissions and the projects it reaches.
  2. Copy the token, which starts with tvk_.
  3. In NappAI, create a XoneWork credential: in XoneWork address type the address of your XoneWork, for example https://xonework.app, and paste the token in API token.
  4. Choose that credential in the component’s Credential field.
FieldWhat it does
Credential (required)The XoneWork credential. It fills XoneWork Address and XoneWork API Token.
OperationWhat you do with the comments. Default: List Comments.
TaskThe task’s key, for example XONE-12, or its id. Default {key}: in batch mode it takes the key of the task that reaches the node.
CommentThe text of the comment, up to 5000 characters. Plain text.
Comment IDThe id of the comment, returned by List Comments.
Max ResultsHow many of the most recent comments to return. Default: 50.

Operations

OperationWhat it doesFields
List CommentsReads the latest comments of a task.Task. Optional: Max Results.
Add CommentWrites a comment on a task.Task, Comment
Update CommentChanges the text of a comment this account wrote.Comment ID, Comment
Delete CommentDeletes a comment this account wrote.Comment ID

Output

The Data output returns one item per comment with these fields:

  • key: the task’s key.
  • comment_id: the comment’s id.
  • body: the text.
  • author: who wrote it.
  • created_at and edited_at: when it was written and when it was changed.

The component can be connected to an Agent as a tool: each node is one tool with its operation. See Tools.

Example

An agent that develops tasks asks when something is missing.

  1. XoneWork Trigger starts the flow with the task assigned to the agent.
  2. XoneWork Comments with List Comments reads what has been said on the task, and XoneWork Tasks with Get Task reads its note.
  3. An agent receives both. Its tool is another XoneWork Comments with Add Comment, Task set to {key} and Comment left to the agent, to ask about anything that is unclear.

Good practices

  • Write plain text: XoneWork shows HTML and Markdown as they are, without formatting.
  • For an agent’s report that repeats on every run, use XoneWork Tasks with Update Task and Replace Section instead of a new comment each time.
  • As a tool, let the agent write Comment.

Security and limitations

  • The token acts as the person who created it: comments appear under their name. Limit it in XoneWork to the permissions and projects the flow needs.
  • The token never appears in the node: the credential fills it.
  • Only the comments the token’s account wrote can be changed or deleted.
  • A comment has at most 5000 characters.