arazzo: 1.0.1
info:
title: Asana Find, Comment On, and Complete a Task
summary: Read a task, post a closing comment, and mark it complete in a single closeout pass.
description: >-
A task closeout flow. The workflow reads a task to confirm it exists and is
not already complete, posts a closing comment (story) describing the
resolution, and then marks the task complete. The flow branches on the
current completed state so an already-complete task skips straight to the
end. Each request is written inline so the closeout can be read and executed
without opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-900.30
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-900.30
capability_name: Project Management
spec: asana-tasks-api-openapi.yml
confidence: 0.85
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: storiesApi
url: ../openapi/asana-stories-api-openapi.yml
type: openapi
- name: tasksApi
url: ../openapi/asana-tasks-api-openapi.yml
type: openapi
workflows:
- workflowId: complete-task-with-comment
summary: Comment on a task and mark it complete unless it is already done.
description: >-
Reads a task, branches on its completed flag, posts a closing comment, and
marks the task complete.
inputs:
type: object
required:
- taskGid
- commentText
properties:
taskGid:
type: string
description: The gid of the task to close out.
commentText:
type: string
description: Closing comment to post before completing the task.
steps:
- stepId: readTask
description: Read the task and capture its current completed state.
operationId: $sourceDescriptions.tasksApi.getTask
parameters:
- name: task_gid
in: path
value: $inputs.taskGid
- name: opt_fields
in: query
value: name,completed
successCriteria:
- condition: $statusCode == 200
outputs:
completed: $response.body#/data/completed
onSuccess:
- name: alreadyComplete
type: end
criteria:
- condition: $response.body#/data/completed == true
- name: needsCompletion
type: goto
stepId: postClosingComment
criteria:
- condition: $response.body#/data/completed == false
- stepId: postClosingComment
description: Post a closing comment describing the resolution.
operationId: $sourceDescriptions.storiesApi.createStoryForTask
parameters:
- name: task_gid
in: path
value: $inputs.taskGid
requestBody:
contentType: application/json
payload:
data:
text: $inputs.commentText
successCriteria:
- condition: $statusCode == 201
outputs:
storyGid: $response.body#/data/gid
- stepId: completeTask
description: Mark the task complete.
operationId: $sourceDescriptions.tasksApi.updateTask
parameters:
- name: task_gid
in: path
value: $inputs.taskGid
- name: opt_fields
in: query
value: name,completed,completed_at
requestBody:
contentType: application/json
payload:
data:
completed: true
successCriteria:
- condition: $statusCode == 200
outputs:
completed: $response.body#/data/completed
completedAt: $response.body#/data/completed_at
outputs:
taskGid: $inputs.taskGid
completed: $steps.completeTask.outputs.completed
storyGid: $steps.postClosingComment.outputs.storyGid
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.