Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(asana): add 65 AI agent actions for tasks, projects, sections and tags (#15757)

Odai Ahmad564c98dc7a78
diff --git a/bun.lock b/bun.lock
index f0fc9471100..2cf5072b798 100644
--- a/bun.lock
+++ b/bun.lock
@@ -752,7 +752,7 @@
},
"packages/pieces/community/asana": {
"name": "@activepieces/piece-asana",
- "version": "0.5.0",
+ "version": "0.6.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/asana/package.json b/packages/pieces/community/asana/package.json
index 696f76e9b16..07d3fc9534a 100644
--- a/packages/pieces/community/asana/package.json
+++ b/packages/pieces/community/asana/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-asana",
- "version": "0.5.0",
+ "version": "0.6.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/asana/src/i18n/translation.json b/packages/pieces/community/asana/src/i18n/translation.json
index 3cdb14d17fe..0560c099af5 100644
--- a/packages/pieces/community/asana/src/i18n/translation.json
+++ b/packages/pieces/community/asana/src/i18n/translation.json
@@ -38,5 +38,414 @@
"None": "None",
"JSON": "JSON",
"Form Data": "Form Data",
- "Raw": "Raw"
+ "Raw": "Raw",
+ "Get Current User": "Get Current User",
+ "List Workspaces": "List Workspaces",
+ "List Teams": "List Teams",
+ "Search Workspace Objects": "Search Workspace Objects",
+ "Create Project Task": "Create Project Task",
+ "Get Task": "Get Task",
+ "Update Task": "Update Task",
+ "Delete Task": "Delete Task",
+ "Duplicate Task": "Duplicate Task",
+ "Get Job": "Get Job",
+ "List Assigned Tasks": "List Assigned Tasks",
+ "List Project Tasks": "List Project Tasks",
+ "List Subtasks": "List Subtasks",
+ "Create Subtask": "Create Subtask",
+ "Set Task Parent": "Set Task Parent",
+ "List Task Projects": "List Task Projects",
+ "Add Task to Project": "Add Task to Project",
+ "Remove Task from Project": "Remove Task from Project",
+ "Add Task Followers": "Add Task Followers",
+ "Remove Task Followers": "Remove Task Followers",
+ "Add Task Comment": "Add Task Comment",
+ "List Task Stories": "List Task Stories",
+ "Get Story": "Get Story",
+ "Update Comment": "Update Comment",
+ "Delete Comment": "Delete Comment",
+ "Create Project": "Create Project",
+ "Get Project": "Get Project",
+ "List Projects": "List Projects",
+ "Update Project": "Update Project",
+ "Delete Project": "Delete Project",
+ "Duplicate Project": "Duplicate Project",
+ "Get Project Task Counts": "Get Project Task Counts",
+ "Add Project Members": "Add Project Members",
+ "Remove Project Members": "Remove Project Members",
+ "Add Project Followers": "Add Project Followers",
+ "Remove Project Followers": "Remove Project Followers",
+ "Create Section": "Create Section",
+ "Get Section": "Get Section",
+ "List Sections": "List Sections",
+ "Rename Section": "Rename Section",
+ "Delete Section": "Delete Section",
+ "Move Section": "Move Section",
+ "Move Task to Section": "Move Task to Section",
+ "List Section Tasks": "List Section Tasks",
+ "Create Membership": "Create Membership",
+ "Get Membership": "Get Membership",
+ "List Memberships": "List Memberships",
+ "Delete Membership": "Delete Membership",
+ "Create Status Update": "Create Status Update",
+ "Get Status Update": "Get Status Update",
+ "List Status Updates": "List Status Updates",
+ "Delete Status Update": "Delete Status Update",
+ "Create Project Brief": "Create Project Brief",
+ "Get Project Brief": "Get Project Brief",
+ "Update Project Brief": "Update Project Brief",
+ "Delete Project Brief": "Delete Project Brief",
+ "Create Tag": "Create Tag",
+ "Get Tag": "Get Tag",
+ "List Tags": "List Tags",
+ "Update Tag": "Update Tag",
+ "Delete Tag": "Delete Tag",
+ "List Task Tags": "List Task Tags",
+ "Add Tag to Task": "Add Tag to Task",
+ "Remove Tag from Task": "Remove Tag from Task",
+ "List Tag Tasks": "List Tag Tasks",
+ "Get the Asana user behind this connection.": "Get the Asana user behind this connection.",
+ "List the workspaces and organizations the connected user can access.": "List the workspaces and organizations the connected user can access.",
+ "List the teams in an Asana organization.": "List the teams in an Asana organization.",
+ "Find tasks, projects, users, tags or teams by name in a workspace.": "Find tasks, projects, users, tags or teams by name in a workspace.",
+ "Create a task in an Asana project.": "Create a task in an Asana project.",
+ "Get the details of an Asana task.": "Get the details of an Asana task.",
+ "Change fields of an existing Asana task.": "Change fields of an existing Asana task.",
+ "Delete an Asana task.": "Delete an Asana task.",
+ "Start copying an Asana task into a new task.": "Start copying an Asana task into a new task.",
+ "Check the status of an asynchronous Asana job.": "Check the status of an asynchronous Asana job.",
+ "List the tasks assigned to a user in a workspace.": "List the tasks assigned to a user in a workspace.",
+ "List the tasks in an Asana project.": "List the tasks in an Asana project.",
+ "List the subtasks of an Asana task.": "List the subtasks of an Asana task.",
+ "Create a subtask under an existing Asana task.": "Create a subtask under an existing Asana task.",
+ "Make a task a subtask of another task, or detach it from its parent.": "Make a task a subtask of another task, or detach it from its parent.",
+ "List the projects an Asana task belongs to.": "List the projects an Asana task belongs to.",
+ "Add an existing task to another Asana project.": "Add an existing task to another Asana project.",
+ "Remove a task from one of its Asana projects.": "Remove a task from one of its Asana projects.",
+ "Add followers (collaborators) to an Asana task.": "Add followers (collaborators) to an Asana task.",
+ "Remove followers from an Asana task.": "Remove followers from an Asana task.",
+ "Post a comment on an Asana task.": "Post a comment on an Asana task.",
+ "List the comments and activity of an Asana task.": "List the comments and activity of an Asana task.",
+ "Get one comment or activity entry of an Asana task.": "Get one comment or activity entry of an Asana task.",
+ "Edit or pin a comment on an Asana task.": "Edit or pin a comment on an Asana task.",
+ "Delete a comment from an Asana task.": "Delete a comment from an Asana task.",
+ "Create a new Asana project.": "Create a new Asana project.",
+ "Get the details of an Asana project.": "Get the details of an Asana project.",
+ "List the projects in an Asana workspace.": "List the projects in an Asana workspace.",
+ "Change fields of an existing Asana project.": "Change fields of an existing Asana project.",
+ "Delete an Asana project.": "Delete an Asana project.",
+ "Start copying an Asana project into a new project.": "Start copying an Asana project into a new project.",
+ "Get the number of total, completed and open tasks and milestones in a project.": "Get the number of total, completed and open tasks and milestones in a project.",
+ "Give users access to an Asana project.": "Give users access to an Asana project.",
+ "Revoke users' membership of an Asana project.": "Revoke users' membership of an Asana project.",
+ "Subscribe users to \"task added\" notifications of an Asana project.": "Subscribe users to \"task added\" notifications of an Asana project.",
+ "Unsubscribe users from \"task added\" notifications of an Asana project.": "Unsubscribe users from \"task added\" notifications of an Asana project.",
+ "Create a section (list heading or board column) in an Asana project.": "Create a section (list heading or board column) in an Asana project.",
+ "Get the details of an Asana section.": "Get the details of an Asana section.",
+ "List the sections of an Asana project.": "List the sections of an Asana project.",
+ "Rename an Asana section.": "Rename an Asana section.",
+ "Delete an empty section from an Asana project.": "Delete an empty section from an Asana project.",
+ "Reorder a section within its Asana project.": "Reorder a section within its Asana project.",
+ "Move a task into a section of an Asana project.": "Move a task into a section of an Asana project.",
+ "List the tasks in one section of an Asana project.": "List the tasks in one section of an Asana project.",
+ "Get one membership of a project, goal or portfolio.": "Get one membership of a project, goal or portfolio.",
+ "List who has access to a project, goal or portfolio, or which projects a team is in.": "List who has access to a project, goal or portfolio, or which projects a team is in.",
+ "Revoke a user's or team's access to a project, goal or portfolio.": "Revoke a user's or team's access to a project, goal or portfolio.",
+ "Post a status update on an Asana project, portfolio or goal.": "Post a status update on an Asana project, portfolio or goal.",
+ "Get one status update of an Asana project, portfolio or goal.": "Get one status update of an Asana project, portfolio or goal.",
+ "List the status updates of an Asana project, portfolio or goal.": "List the status updates of an Asana project, portfolio or goal.",
+ "Delete a status update from an Asana project, portfolio or goal.": "Delete a status update from an Asana project, portfolio or goal.",
+ "Create the brief (overview document) of an Asana project.": "Create the brief (overview document) of an Asana project.",
+ "Get the brief (overview document) of an Asana project.": "Get the brief (overview document) of an Asana project.",
+ "Change the title or body of an Asana project brief.": "Change the title or body of an Asana project brief.",
+ "Delete the brief of an Asana project.": "Delete the brief of an Asana project.",
+ "Create a tag in an Asana workspace.": "Create a tag in an Asana workspace.",
+ "Get the details of an Asana tag.": "Get the details of an Asana tag.",
+ "List the tags in an Asana workspace.": "List the tags in an Asana workspace.",
+ "Rename or recolor an Asana tag.": "Rename or recolor an Asana tag.",
+ "Delete an Asana tag.": "Delete an Asana tag.",
+ "List the tags on an Asana task.": "List the tags on an Asana task.",
+ "Apply a tag to an Asana task.": "Apply a tag to an Asana task.",
+ "Take a tag off an Asana task.": "Take a tag off an Asana task.",
+ "List the tasks that carry an Asana tag.": "List the tasks that carry an Asana tag.",
+ "Limit": "Limit",
+ "Offset": "Offset",
+ "Organization (Workspace) GID": "Organization (Workspace) GID",
+ "Workspace GID": "Workspace GID",
+ "Object Type": "Object Type",
+ "Query": "Query",
+ "Count": "Count",
+ "Project GID": "Project GID",
+ "Description": "Description",
+ "HTML Description": "HTML Description",
+ "Due Date and Time": "Due Date and Time",
+ "Start Date": "Start Date",
+ "Followers": "Followers",
+ "Task GID": "Task GID",
+ "Completed": "Completed",
+ "New Task Name": "New Task Name",
+ "Include": "Include",
+ "Job GID": "Job GID",
+ "Completed Since": "Completed Since",
+ "Modified Since": "Modified Since",
+ "Parent Task GID": "Parent Task GID",
+ "Subtask Name": "Subtask Name",
+ "Insert Before Subtask": "Insert Before Subtask",
+ "Insert After Subtask": "Insert After Subtask",
+ "Section GID": "Section GID",
+ "Insert Before Task": "Insert Before Task",
+ "Insert After Task": "Insert After Task",
+ "Text": "Text",
+ "HTML Text": "HTML Text",
+ "Pin Comment": "Pin Comment",
+ "Story GID": "Story GID",
+ "Comment (Story) GID": "Comment (Story) GID",
+ "Pinned": "Pinned",
+ "Team GID": "Team GID",
+ "Project Name": "Project Name",
+ "Color": "Color",
+ "Default View": "Default View",
+ "Privacy": "Privacy",
+ "Archived": "Archived",
+ "Owner": "Owner",
+ "New Project Name": "New Project Name",
+ "Members": "Members",
+ "Section Name": "Section Name",
+ "Insert Before Section": "Insert Before Section",
+ "Insert After Section": "Insert After Section",
+ "Before Section": "Before Section",
+ "After Section": "After Section",
+ "Parent GID": "Parent GID",
+ "Member GID": "Member GID",
+ "Access Level": "Access Level",
+ "Membership GID": "Membership GID",
+ "Status": "Status",
+ "Title": "Title",
+ "Status Update GID": "Status Update GID",
+ "Created Since": "Created Since",
+ "Project Brief GID": "Project Brief GID",
+ "Tag Name": "Tag Name",
+ "Tag GID": "Tag GID",
+ "Maximum number of workspaces to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of workspaces to return in this page, from 1 to 100. Defaults to 50.",
+ "Pagination token for the next page. Pass the `next_offset` value returned by the previous call of this same action; leave empty for the first page. Tokens expire after a while.": "Pagination token for the next page. Pass the `next_offset` value returned by the previous call of this same action; leave empty for the first page. Tokens expire after a while.",
+ "Gid of the organization, for example 1201234567890123. Obtain it from List Workspaces (is_organization must be true).": "Gid of the organization, for example 1201234567890123. Obtain it from List Workspaces (is_organization must be true).",
+ "Maximum number of teams to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of teams to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the workspace to search, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.": "Gid of the workspace to search, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.",
+ "Which kind of object to return.": "Which kind of object to return.",
+ "Text to match against object names, for example \"Q4 launch\". Leave empty to get recently relevant objects of this type.": "Text to match against object names, for example \"Q4 launch\". Leave empty to get recently relevant objects of this type.",
+ "Number of results to return, from 1 to 100. Defaults to 20.": "Number of results to return, from 1 to 100. Defaults to 20.",
+ "Gid of the workspace that owns the project, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.": "Gid of the workspace that owns the project, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.",
+ "Gid of the project to create the task in. Obtain it from List Projects or Search Workspace Objects (object type project).": "Gid of the project to create the task in. Obtain it from List Projects or Search Workspace Objects (object type project).",
+ "Short title of the task, for example \"Draft launch email\".": "Short title of the task, for example \"Draft launch email\".",
+ "Plain-text description of the task. Cannot be combined with HTML Description.": "Plain-text description of the task. Cannot be combined with HTML Description.",
+ "Rich-text description in Asana rich text, wrapped in <body>...</body>, for example <body>See <strong>brief</strong></body>. Cannot be combined with Description.": "Rich-text description in Asana rich text, wrapped in <body>...</body>, for example <body>See <strong>brief</strong></body>. Cannot be combined with Description.",
+ "User to assign: \"me\", an email address or a user gid.": "User to assign: \"me\", an email address or a user gid.",
+ "All-day due date in YYYY-MM-DD format, for example 2026-10-15. Cannot be combined with Due Date and Time.": "All-day due date in YYYY-MM-DD format, for example 2026-10-15. Cannot be combined with Due Date and Time.",
+ "Start date in YYYY-MM-DD format. Asana requires a due date or due time when a start date is set.": "Start date in YYYY-MM-DD format. Asana requires a due date or due time when a start date is set.",
+ "Users to add as followers, one per item: \"me\", an email address or a user gid.": "Users to add as followers, one per item: \"me\", an email address or a user gid.",
+ "Gid of the task, for example 1204567890123456. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.": "Gid of the task, for example 1204567890123456. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.",
+ "Gid of the task to update. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.": "Gid of the task to update. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.",
+ "New title of the task. Leave empty to keep the current name.": "New title of the task. Leave empty to keep the current name.",
+ "New plain-text description; replaces the whole current description. Cannot be combined with HTML Description. Leave empty to keep it.": "New plain-text description; replaces the whole current description. Cannot be combined with HTML Description. Leave empty to keep it.",
+ "New rich-text description wrapped in <body>...</body>; replaces the whole current description. Cannot be combined with Description.": "New rich-text description wrapped in <body>...</body>; replaces the whole current description. Cannot be combined with Description.",
+ "New assignee: \"me\", an email address or a user gid. Leave empty to keep the current assignee.": "New assignee: \"me\", an email address or a user gid. Leave empty to keep the current assignee.",
+ "New all-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.": "New all-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.",
+ "New start date in YYYY-MM-DD format. The task must have (or get) a due date.": "New start date in YYYY-MM-DD format. The task must have (or get) a due date.",
+ "Yes marks the task complete, No reopens it. Leave empty to keep the current state.": "Yes marks the task complete, No reopens it. Leave empty to keep the current state.",
+ "Gid of the task to delete. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.": "Gid of the task to delete. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.",
+ "Gid of the task to copy. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the task to copy. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Name of the new task, for example \"Copy of Draft launch email\".": "Name of the new task, for example \"Copy of Draft launch email\".",
+ "Parts of the original task to copy. Leave empty to copy only the name.": "Parts of the original task to copy. Leave empty to copy only the name.",
+ "Gid of the job returned by Duplicate Task or Duplicate Project.": "Gid of the job returned by Duplicate Task or Duplicate Project.",
+ "\"me\", an email address or a user gid.": "\"me\", an email address or a user gid.",
+ "Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.": "Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.",
+ "Return incomplete tasks plus tasks completed after this ISO 8601 date-time. Use \"now\" to return only incomplete tasks. Leave empty to return all tasks.": "Return incomplete tasks plus tasks completed after this ISO 8601 date-time. Use \"now\" to return only incomplete tasks. Leave empty to return all tasks.",
+ "Only return tasks changed after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.": "Only return tasks changed after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.",
+ "Maximum number of tasks to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of tasks to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the project. Obtain it from List Projects or Search Workspace Objects (object type project).": "Gid of the project. Obtain it from List Projects or Search Workspace Objects (object type project).",
+ "Gid of the parent task. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the parent task. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Maximum number of subtasks to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of subtasks to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the task that will contain the subtask. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the task that will contain the subtask. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Short title of the subtask, for example \"Collect screenshots\".": "Short title of the subtask, for example \"Collect screenshots\".",
+ "Plain-text description. Cannot be combined with HTML Description.": "Plain-text description. Cannot be combined with HTML Description.",
+ "Rich-text description wrapped in <body>...</body>. Cannot be combined with Description.": "Rich-text description wrapped in <body>...</body>. Cannot be combined with Description.",
+ "All-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.": "All-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.",
+ "Start date in YYYY-MM-DD format. Requires a due date or due time.": "Start date in YYYY-MM-DD format. Requires a due date or due time.",
+ "Gid of the task to move. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the task to move. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Gid of the new parent task, or \"none\" to remove the current parent.": "Gid of the new parent task, or \"none\" to remove the current parent.",
+ "Gid of an existing subtask of the new parent to place this task before. Cannot be combined with Insert After Subtask.": "Gid of an existing subtask of the new parent to place this task before. Cannot be combined with Insert After Subtask.",
+ "Gid of an existing subtask of the new parent to place this task after. Cannot be combined with Insert Before Subtask.": "Gid of an existing subtask of the new parent to place this task after. Cannot be combined with Insert Before Subtask.",
+ "Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Maximum number of projects to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of projects to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the project to add the task to. Obtain it from List Projects.": "Gid of the project to add the task to. Obtain it from List Projects.",
+ "Gid of a section in that project to put the task in (at the bottom). Obtain it from List Sections.": "Gid of a section in that project to put the task in (at the bottom). Obtain it from List Sections.",
+ "Gid of a task in the project to place this task before. Cannot be combined with Insert After Task.": "Gid of a task in the project to place this task before. Cannot be combined with Insert After Task.",
+ "Gid of a task in the project to place this task after. Cannot be combined with Insert Before Task.": "Gid of a task in the project to place this task after. Cannot be combined with Insert Before Task.",
+ "Gid of the project to remove the task from. Obtain it from List Task Projects.": "Gid of the project to remove the task from. Obtain it from List Task Projects.",
+ "Users to add, one per item: \"me\", an email address or a user gid.": "Users to add, one per item: \"me\", an email address or a user gid.",
+ "Users to remove, one per item: \"me\", an email address or a user gid.": "Users to remove, one per item: \"me\", an email address or a user gid.",
+ "Gid of the task to comment on. Obtain it from List Project Tasks or Search Workspace Objects.": "Gid of the task to comment on. Obtain it from List Project Tasks or Search Workspace Objects.",
+ "Plain-text comment. Provide this or HTML Text, not both.": "Plain-text comment. Provide this or HTML Text, not both.",
+ "Rich-text comment in Asana rich text, wrapped in <body>...</body>, for example <body>Done, see <a href=\"https://example.com\">the doc</a></body>. Provide this or Text, not both.": "Rich-text comment in Asana rich text, wrapped in <body>...</body>, for example <body>Done, see <a href=\"https://example.com\">the doc</a></body>. Provide this or Text, not both.",
+ "Yes pins the comment to the top of the task. Leave empty to post it unpinned.": "Yes pins the comment to the top of the task. Leave empty to post it unpinned.",
+ "Maximum number of stories to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of stories to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the story. Obtain it from List Task Stories or Add Task Comment.": "Gid of the story. Obtain it from List Task Stories or Add Task Comment.",
+ "Gid of the comment story. Obtain it from List Task Stories or Add Task Comment.": "Gid of the comment story. Obtain it from List Task Stories or Add Task Comment.",
+ "New plain-text comment; replaces the current text. Cannot be combined with HTML Text.": "New plain-text comment; replaces the current text. Cannot be combined with HTML Text.",
+ "New rich-text comment wrapped in <body>...</body>; replaces the current text. Cannot be combined with Text.": "New rich-text comment wrapped in <body>...</body>; replaces the current text. Cannot be combined with Text.",
+ "Yes pins the comment, No unpins it. Leave empty to keep the current state.": "Yes pins the comment, No unpins it. Leave empty to keep the current state.",
+ "Gid of the workspace or organization, for example 1201234567890123. Obtain it from List Workspaces.": "Gid of the workspace or organization, for example 1201234567890123. Obtain it from List Workspaces.",
+ "Gid of the team to share the project with. Needed when the workspace is an organization; obtain it from List Teams. Asana is phasing this field out in favour of Create Membership with the team as member.": "Gid of the team to share the project with. Needed when the workspace is an organization; obtain it from List Teams. Asana is phasing this field out in favour of Create Membership with the team as member.",
+ "Name of the project, for example \"Q4 Launch\".": "Name of the project, for example \"Q4 Launch\".",
+ "Plain-text description of the project.": "Plain-text description of the project.",
+ "Project color. Leave empty for the default.": "Project color. Leave empty for the default.",
+ "View the project opens in. Leave empty for list.": "View the project opens in. Leave empty for list.",
+ "Who can see the project. Leave empty for the workspace default. Admins may restrict the allowed values.": "Who can see the project. Leave empty for the workspace default. Admins may restrict the allowed values.",
+ "Project start date in YYYY-MM-DD format. Requires a due date.": "Project start date in YYYY-MM-DD format. Requires a due date.",
+ "Project due date in YYYY-MM-DD format.": "Project due date in YYYY-MM-DD format.",
+ "Yes returns only archived projects, No only active ones. Leave empty to return both.": "Yes returns only archived projects, No only active ones. Leave empty to return both.",
+ "Gid of the project to update. Obtain it from List Projects or Search Workspace Objects.": "Gid of the project to update. Obtain it from List Projects or Search Workspace Objects.",
+ "New project name. Leave empty to keep it.": "New project name. Leave empty to keep it.",
+ "New plain-text description; replaces the current one. Leave empty to keep it.": "New plain-text description; replaces the current one. Leave empty to keep it.",
+ "New project color. Leave empty to keep it.": "New project color. Leave empty to keep it.",
+ "New default view. Leave empty to keep it.": "New default view. Leave empty to keep it.",
+ "New privacy setting. Making a project private hides it from non-members. Leave empty to keep it.": "New privacy setting. Making a project private hides it from non-members. Leave empty to keep it.",
+ "New owner: \"me\", an email address or a user gid. Leave empty to keep it.": "New owner: \"me\", an email address or a user gid. Leave empty to keep it.",
+ "New start date in YYYY-MM-DD format. The project must have a due date.": "New start date in YYYY-MM-DD format. The project must have a due date.",
+ "New due date in YYYY-MM-DD format.": "New due date in YYYY-MM-DD format.",
+ "Yes archives the project, No unarchives it. Leave empty to keep the current state.": "Yes archives the project, No unarchives it. Leave empty to keep the current state.",
+ "Gid of the project to delete. Obtain it from List Projects or Search Workspace Objects.": "Gid of the project to delete. Obtain it from List Projects or Search Workspace Objects.",
+ "Gid of the project to copy. Obtain it from List Projects or Search Workspace Objects.": "Gid of the project to copy. Obtain it from List Projects or Search Workspace Objects.",
+ "Name of the new project, for example \"Q1 Launch\".": "Name of the new project, for example \"Q1 Launch\".",
+ "Optional parts to copy in addition to tasks, views and rules.": "Optional parts to copy in addition to tasks, views and rules.",
+ "Gid of the project. Obtain it from List Projects or Search Workspace Objects.": "Gid of the project. Obtain it from List Projects or Search Workspace Objects.",
+ "Name of the section, for example \"In review\". Cannot be empty.": "Name of the section, for example \"In review\". Cannot be empty.",
+ "Gid of an existing section in this project to place the new one before. Cannot be combined with Insert After Section.": "Gid of an existing section in this project to place the new one before. Cannot be combined with Insert After Section.",
+ "Gid of an existing section in this project to place the new one after. Cannot be combined with Insert Before Section.": "Gid of an existing section in this project to place the new one after. Cannot be combined with Insert Before Section.",
+ "Gid of the section. Obtain it from List Sections.": "Gid of the section. Obtain it from List Sections.",
+ "Maximum number of sections to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of sections to return in this page, from 1 to 100. Defaults to 50.",
+ "New name of the section. Cannot be empty.": "New name of the section. Cannot be empty.",
+ "Gid of the section to delete. Obtain it from List Sections.": "Gid of the section to delete. Obtain it from List Sections.",
+ "Gid of the project both sections belong to. Obtain it from List Projects.": "Gid of the project both sections belong to. Obtain it from List Projects.",
+ "Gid of the section to move. Obtain it from List Sections.": "Gid of the section to move. Obtain it from List Sections.",
+ "Gid of the section to place it immediately before. Provide this or After Section.": "Gid of the section to place it immediately before. Provide this or After Section.",
+ "Gid of the section to place it immediately after. Provide this or Before Section.": "Gid of the section to place it immediately after. Provide this or Before Section.",
+ "Gid of the target section. Obtain it from List Sections.": "Gid of the target section. Obtain it from List Sections.",
+ "Gid of a task in the section to place this task before. Cannot be combined with Insert After Task.": "Gid of a task in the section to place this task before. Cannot be combined with Insert After Task.",
+ "Gid of a task in the section to place this task after. Cannot be combined with Insert Before Task.": "Gid of a task in the section to place this task after. Cannot be combined with Insert Before Task.",
+ "Gid of the user or team to add. Obtain a team gid from List Teams, or a user gid from Get Current User or Search Workspace Objects.": "Gid of the user or team to add. Obtain a team gid from List Teams, or a user gid from Get Current User or Search Workspace Objects.",
+ "Access to grant; valid values depend on the parent type. Leave empty for the parent's default.": "Access to grant; valid values depend on the parent type. Leave empty for the parent's default.",
+ "Gid of the membership. Obtain it from List Memberships or Create Membership.": "Gid of the membership. Obtain it from List Memberships or Create Membership.",
+ "Gid of the project, goal or portfolio whose members to list. Leave empty only when Member is a team.": "Gid of the project, goal or portfolio whose members to list. Leave empty only when Member is a team.",
+ "Gid of a user or team to filter on. Required (and must be a team) when Parent is empty.": "Gid of a user or team to filter on. Required (and must be a team) when Parent is empty.",
+ "Maximum number of memberships to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of memberships to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the membership to delete. Obtain it from List Memberships.": "Gid of the membership to delete. Obtain it from List Memberships.",
+ "Gid of the project (or portfolio or goal) to post on. Obtain a project gid from List Projects.": "Gid of the project (or portfolio or goal) to post on. Obtain a project gid from List Projects.",
+ "Overall status; valid values depend on the parent type.": "Overall status; valid values depend on the parent type.",
+ "Headline of the update, for example \"Week 40: on track for launch\".": "Headline of the update, for example \"Week 40: on track for launch\".",
+ "Plain-text body of the update. Required by Asana even when HTML Text is also set.": "Plain-text body of the update. Required by Asana even when HTML Text is also set.",
+ "Optional rich-text body in Asana rich text, wrapped in <body>...</body>.": "Optional rich-text body in Asana rich text, wrapped in <body>...</body>.",
+ "Gid of the status update. Obtain it from List Status Updates or Create Status Update.": "Gid of the status update. Obtain it from List Status Updates or Create Status Update.",
+ "Gid of the project, portfolio or goal. Obtain a project gid from List Projects.": "Gid of the project, portfolio or goal. Obtain a project gid from List Projects.",
+ "Only return updates created after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.": "Only return updates created after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.",
+ "Maximum number of status updates to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of status updates to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the status update to delete. Obtain it from List Status Updates.": "Gid of the status update to delete. Obtain it from List Status Updates.",
+ "Title of the brief, for example \"Launch plan\".": "Title of the brief, for example \"Launch plan\".",
+ "Body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.": "Body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.",
+ "Gid of the project brief. Obtain it from the project_brief field of Get Project, or from Create Project Brief.": "Gid of the project brief. Obtain it from the project_brief field of Get Project, or from Create Project Brief.",
+ "Gid of the project brief. Obtain it from the project_brief field of Get Project.": "Gid of the project brief. Obtain it from the project_brief field of Get Project.",
+ "New title. Leave empty to keep it.": "New title. Leave empty to keep it.",
+ "New body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.": "New body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.",
+ "New plain-text body. Cannot be combined with HTML Text.": "New plain-text body. Cannot be combined with HTML Text.",
+ "Gid of the project brief to delete. Obtain it from the project_brief field of Get Project.": "Gid of the project brief to delete. Obtain it from the project_brief field of Get Project.",
+ "Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces.": "Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces.",
+ "Name of the tag, for example \"urgent\".": "Name of the tag, for example \"urgent\".",
+ "Tag color. Leave empty for no color.": "Tag color. Leave empty for no color.",
+ "Optional description of what the tag means.": "Optional description of what the tag means.",
+ "Gid of the tag. Obtain it from List Tags, List Task Tags or Search Workspace Objects (object type tag).": "Gid of the tag. Obtain it from List Tags, List Task Tags or Search Workspace Objects (object type tag).",
+ "Maximum number of tags to return in this page, from 1 to 100. Defaults to 50.": "Maximum number of tags to return in this page, from 1 to 100. Defaults to 50.",
+ "Gid of the tag. Obtain it from List Tags or Search Workspace Objects.": "Gid of the tag. Obtain it from List Tags or Search Workspace Objects.",
+ "New name. Leave empty to keep it.": "New name. Leave empty to keep it.",
+ "New color. Leave empty to keep it.": "New color. Leave empty to keep it.",
+ "New description; replaces the current one. Leave empty to keep it.": "New description; replaces the current one. Leave empty to keep it.",
+ "Gid of the tag to delete. Obtain it from List Tags.": "Gid of the tag to delete. Obtain it from List Tags.",
+ "Gid of the tag to apply. Obtain it from List Tags or Search Workspace Objects (object type tag).": "Gid of the tag to apply. Obtain it from List Tags or Search Workspace Objects (object type tag).",
+ "Gid of the tag to remove. Obtain it from List Task Tags.": "Gid of the tag to remove. Obtain it from List Task Tags.",
+ "Gid of the tag. Obtain it from List Tags or Search Workspace Objects (object type tag).": "Gid of the tag. Obtain it from List Tags or Search Workspace Objects (object type tag).",
+ "Task": "Task",
+ "User": "User",
+ "Tag": "Tag",
+ "Team": "Team",
+ "Portfolio": "Portfolio",
+ "Goal": "Goal",
+ "Custom field": "Custom field",
+ "Project template": "Project template",
+ "Yes": "Yes",
+ "No": "No",
+ "Attachments": "Attachments",
+ "Dates": "Dates",
+ "Dependencies": "Dependencies",
+ "Description (notes)": "Description (notes)",
+ "Parent task": "Parent task",
+ "Projects": "Projects",
+ "Subtasks": "Subtasks",
+ "dark-pink": "dark-pink",
+ "dark-green": "dark-green",
+ "dark-blue": "dark-blue",
+ "dark-red": "dark-red",
+ "dark-teal": "dark-teal",
+ "dark-brown": "dark-brown",
+ "dark-orange": "dark-orange",
+ "dark-purple": "dark-purple",
+ "dark-warm-gray": "dark-warm-gray",
+ "light-pink": "light-pink",
+ "light-green": "light-green",
+ "light-blue": "light-blue",
+ "light-red": "light-red",
+ "light-teal": "light-teal",
+ "light-brown": "light-brown",
+ "light-orange": "light-orange",
+ "light-purple": "light-purple",
+ "light-warm-gray": "light-warm-gray",
+ "List": "List",
+ "Board": "Board",
+ "Calendar": "Calendar",
+ "Timeline": "Timeline",
+ "Public to workspace": "Public to workspace",
+ "Private (members only)": "Private (members only)",
+ "Project description (notes)": "Project description (notes)",
+ "Forms": "Forms",
+ "Permissions": "Permissions",
+ "Allocations": "Allocations",
+ "Task assignees": "Task assignees",
+ "Task attachments": "Task attachments",
+ "Task dates": "Task dates",
+ "Task dependencies": "Task dependencies",
+ "Task followers": "Task followers",
+ "Task descriptions": "Task descriptions",
+ "Task other projects": "Task other projects",
+ "Task subtasks": "Task subtasks",
+ "Task tags": "Task tags",
+ "Task templates": "Task templates",
+ "Default task type": "Default task type",
+ "Admin": "Admin",
+ "Editor": "Editor",
+ "Commenter": "Commenter",
+ "Viewer": "Viewer",
+ "On track": "On track",
+ "At risk": "At risk",
+ "Off track": "Off track",
+ "On hold (projects and portfolios)": "On hold (projects and portfolios)",
+ "Complete (projects and portfolios)": "Complete (projects and portfolios)",
+ "Achieved (goals)": "Achieved (goals)",
+ "Partial (goals)": "Partial (goals)",
+ "Missed (goals)": "Missed (goals)",
+ "Dropped": "Dropped",
+ "Exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.": "Exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.",
+ "Tags to apply, one per item: a tag gid or the exact tag name in this workspace. Names are matched case-insensitively; an all-digit value is used as a gid when such a tag exists and is otherwise matched as a name; an unknown name fails the call. Create new tags first with Create Tag.": "Tags to apply, one per item: a tag gid or the exact tag name in this workspace. Names are matched case-insensitively; an all-digit value is used as a gid when such a tag exists and is otherwise matched as a name; an unknown name fails the call. Create new tags first with Create Tag.",
+ "New exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.": "New exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.",
+ "Share a project, goal, portfolio or custom field with a user or team.": "Share a project, goal, portfolio or custom field with a user or team.",
+ "User (custom fields only)": "User (custom fields only)",
+ "Gid of the project (or goal, portfolio, custom field or custom type) to share. Obtain a project gid from List Projects.": "Gid of the project (or goal, portfolio, custom field or custom type) to share. Obtain a project gid from List Projects.",
+ "Plain-text body; it is sent to Asana as escaped rich text inside <body>...</body>. Cannot be combined with HTML Text.": "Plain-text body; it is sent to Asana as escaped rich text inside <body>...</body>. Cannot be combined with HTML Text."
}
\ No newline at end of file
diff --git a/packages/pieces/community/asana/src/index.ts b/packages/pieces/community/asana/src/index.ts
index 4f76dd778b1..b4459a8d25a 100644
--- a/packages/pieces/community/asana/src/index.ts
+++ b/packages/pieces/community/asana/src/index.ts
@@ -1,23 +1,152 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
OAuth2PropertyValue,
- PieceAuth,
createPiece,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { asanaCreateTaskAction } from './lib/actions/create-task';
+import { asanaGetCurrentUserAction } from './lib/actions/ai/get-current-user';
+import { asanaListWorkspacesAction } from './lib/actions/ai/list-workspaces';
+import { asanaListTeamsAction } from './lib/actions/ai/list-teams';
+import { asanaSearchWorkspaceObjectsAction } from './lib/actions/ai/search-workspace-objects';
+import { asanaCreateProjectTaskAction } from './lib/actions/ai/create-project-task';
+import { asanaGetTaskAction } from './lib/actions/ai/get-task';
+import { asanaUpdateTaskAction } from './lib/actions/ai/update-task';
+import { asanaDeleteTaskAction } from './lib/actions/ai/delete-task';
+import { asanaDuplicateTaskAction } from './lib/actions/ai/duplicate-task';
+import { asanaGetJobAction } from './lib/actions/ai/get-job';
+import { asanaListAssignedTasksAction } from './lib/actions/ai/list-assigned-tasks';
+import { asanaListProjectTasksAction } from './lib/actions/ai/list-project-tasks';
+import { asanaListSubtasksAction } from './lib/actions/ai/list-subtasks';
+import { asanaCreateSubtaskAction } from './lib/actions/ai/create-subtask';
+import { asanaSetTaskParentAction } from './lib/actions/ai/set-task-parent';
+import { asanaListTaskProjectsAction } from './lib/actions/ai/list-task-projects';
+import { asanaAddTaskToProjectAction } from './lib/actions/ai/add-task-to-project';
+import { asanaRemoveTaskFromProjectAction } from './lib/actions/ai/remove-task-from-project';
+import { asanaAddTaskFollowersAction } from './lib/actions/ai/add-task-followers';
+import { asanaRemoveTaskFollowersAction } from './lib/actions/ai/remove-task-followers';
+import { asanaAddTaskCommentAction } from './lib/actions/ai/add-task-comment';
+import { asanaListTaskStoriesAction } from './lib/actions/ai/list-task-stories';
+import { asanaGetStoryAction } from './lib/actions/ai/get-story';
+import { asanaUpdateCommentAction } from './lib/actions/ai/update-comment';
+import { asanaDeleteCommentAction } from './lib/actions/ai/delete-comment';
+import { asanaCreateProjectAction } from './lib/actions/ai/create-project';
+import { asanaGetProjectAction } from './lib/actions/ai/get-project';
+import { asanaListProjectsAction } from './lib/actions/ai/list-projects';
+import { asanaUpdateProjectAction } from './lib/actions/ai/update-project';
+import { asanaDeleteProjectAction } from './lib/actions/ai/delete-project';
+import { asanaDuplicateProjectAction } from './lib/actions/ai/duplicate-project';
+import { asanaGetProjectTaskCountsAction } from './lib/actions/ai/get-project-task-counts';
+import { asanaAddProjectMembersAction } from './lib/actions/ai/add-project-members';
+import { asanaRemoveProjectMembersAction } from './lib/actions/ai/remove-project-members';
+import { asanaAddProjectFollowersAction } from './lib/actions/ai/add-project-followers';
+import { asanaRemoveProjectFollowersAction } from './lib/actions/ai/remove-project-followers';
+import { asanaCreateSectionAction } from './lib/actions/ai/create-section';
+import { asanaGetSectionAction } from './lib/actions/ai/get-section';
+import { asanaListSectionsAction } from './lib/actions/ai/list-sections';
+import { asanaUpdateSectionAction } from './lib/actions/ai/update-section';
+import { asanaDeleteSectionAction } from './lib/actions/ai/delete-section';
+import { asanaMoveSectionAction } from './lib/actions/ai/move-section';
+import { asanaMoveTaskToSectionAction } from './lib/actions/ai/move-task-to-section';
+import { asanaListSectionTasksAction } from './lib/actions/ai/list-section-tasks';
+import { asanaCreateMembershipAction } from './lib/actions/ai/create-membership';
+import { asanaGetMembershipAction } from './lib/actions/ai/get-membership';
+import { asanaListMembershipsAction } from './lib/actions/ai/list-memberships';
+import { asanaDeleteMembershipAction } from './lib/actions/ai/delete-membership';
+import { asanaCreateStatusUpdateAction } from './lib/actions/ai/create-status-update';
+import { asanaGetStatusUpdateAction } from './lib/actions/ai/get-status-update';
+import { asanaListStatusUpdatesAction } from './lib/actions/ai/list-status-updates';
+import { asanaDeleteStatusUpdateAction } from './lib/actions/ai/delete-status-update';
+import { asanaCreateProjectBriefAction } from './lib/actions/ai/create-project-brief';
+import { asanaGetProjectBriefAction } from './lib/actions/ai/get-project-brief';
+import { asanaUpdateProjectBriefAction } from './lib/actions/ai/update-project-brief';
+import { asanaDeleteProjectBriefAction } from './lib/actions/ai/delete-project-brief';
+import { asanaCreateTagAction } from './lib/actions/ai/create-tag';
+import { asanaGetTagAction } from './lib/actions/ai/get-tag';
+import { asanaListTagsAction } from './lib/actions/ai/list-tags';
+import { asanaUpdateTagAction } from './lib/actions/ai/update-tag';
+import { asanaDeleteTagAction } from './lib/actions/ai/delete-tag';
+import { asanaListTaskTagsAction } from './lib/actions/ai/list-task-tags';
+import { asanaAddTagToTaskAction } from './lib/actions/ai/add-tag-to-task';
+import { asanaRemoveTagFromTaskAction } from './lib/actions/ai/remove-tag-from-task';
+import { asanaListTagTasksAction } from './lib/actions/ai/list-tag-tasks';
import { asanaAuth } from './lib/auth';
export const asana = createPiece({
displayName: 'Asana',
description: "Work management platform designed to help teams organize, track, and manage their work.",
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/asana.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ["ShayPunter","kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
auth: asanaAuth,
actions: [
asanaCreateTaskAction,
+ asanaGetCurrentUserAction,
+ asanaListWorkspacesAction,
+ asanaListTeamsAction,
+ asanaSearchWorkspaceObjectsAction,
+ asanaCreateProjectTaskAction,
+ asanaGetTaskAction,
+ asanaUpdateTaskAction,
+ asanaDeleteTaskAction,
+ asanaDuplicateTaskAction,
+ asanaGetJobAction,
+ asanaListAssignedTasksAction,
+ asanaListProjectTasksAction,
+ asanaListSubtasksAction,
+ asanaCreateSubtaskAction,
+ asanaSetTaskParentAction,
+ asanaListTaskProjectsAction,
+ asanaAddTaskToProjectAction,
+ asanaRemoveTaskFromProjectAction,
+ asanaAddTaskFollowersAction,
+ asanaRemoveTaskFollowersAction,
+ asanaAddTaskCommentAction,
+ asanaListTaskStoriesAction,
+ asanaGetStoryAction,
+ asanaUpdateCommentAction,
+ asanaDeleteCommentAction,
+ asanaCreateProjectAction,
+ asanaGetProjectAction,
+ asanaListProjectsAction,
+ asanaUpdateProjectAction,
+ asanaDeleteProjectAction,
+ asanaDuplicateProjectAction,
+ asanaGetProjectTaskCountsAction,
+ asanaAddProjectMembersAction,
+ asanaRemoveProjectMembersAction,
+ asanaAddProjectFollowersAction,
+ asanaRemoveProjectFollowersAction,
+ asanaCreateSectionAction,
+ asanaGetSectionAction,
+ asanaListSectionsAction,
+ asanaUpdateSectionAction,
+ asanaDeleteSectionAction,
+ asanaMoveSectionAction,
+ asanaMoveTaskToSectionAction,
+ asanaListSectionTasksAction,
+ asanaCreateMembershipAction,
+ asanaGetMembershipAction,
+ asanaListMembershipsAction,
+ asanaDeleteMembershipAction,
+ asanaCreateStatusUpdateAction,
+ asanaGetStatusUpdateAction,
+ asanaListStatusUpdatesAction,
+ asanaDeleteStatusUpdateAction,
+ asanaCreateProjectBriefAction,
+ asanaGetProjectBriefAction,
+ asanaUpdateProjectBriefAction,
+ asanaDeleteProjectBriefAction,
+ asanaCreateTagAction,
+ asanaGetTagAction,
+ asanaListTagsAction,
+ asanaUpdateTagAction,
+ asanaDeleteTagAction,
+ asanaListTaskTagsAction,
+ asanaAddTagToTaskAction,
+ asanaRemoveTagFromTaskAction,
+ asanaListTagTasksAction,
createCustomApiCallAction({
baseUrl: () => `https://app.asana.com/api/1.0`,
auth: asanaAuth,
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-project-followers.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-project-followers.ts
new file mode 100644
index 00000000000..b7bce6b1e84
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-project-followers.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+export const asanaAddProjectFollowersAction = createAction({
+ auth: asanaAuth,
+ name: 'add_project_followers',
+ classification: 'WRITE',
+ displayName: 'Add Project Followers',
+ description: 'Subscribe users to "task added" notifications of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds users as followers of a project so they are notified when tasks are added, and returns the updated project. Users who are not yet members also become members. Existing followers are unaffected, so repeating the call converges and is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to add, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { project, followers } = context.propsValue;
+ const followerList = asanaUtils.toStringArray(followers);
+ if (followerList.length === 0) {
+ throw new Error('Followers must contain at least one user ("me", an email address or a user gid).');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/addFollowers`,
+ operation: 'Add Project Followers',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data: { followers: followerList.join(',') },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-project-members.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-project-members.ts
new file mode 100644
index 00000000000..2a227969798
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-project-members.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+export const asanaAddProjectMembersAction = createAction({
+ auth: asanaAuth,
+ name: 'add_project_members',
+ classification: 'WRITE',
+ displayName: 'Add Project Members',
+ description: 'Give users access to an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds users as members of a project with the project\'s default access level and returns the updated project; their notification settings may also make them followers. Use Create Membership to add a team or to choose the access level. Existing members are unaffected, so repeating the call converges and is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ members: Property.Array({
+ displayName: 'Members',
+ description: 'Users to add, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { project, members } = context.propsValue;
+ const memberList = asanaUtils.toStringArray(members);
+ if (memberList.length === 0) {
+ throw new Error('Members must contain at least one user ("me", an email address or a user gid).');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/addMembers`,
+ operation: 'Add Project Members',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data: { members: memberList.join(',') },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-tag-to-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-tag-to-task.ts
new file mode 100644
index 00000000000..3d51b7983ca
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-tag-to-task.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskTagChangeOutputSchema } from '../../output-schemas';
+
+export const asanaAddTagToTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'add_tag_to_task',
+ classification: 'WRITE',
+ displayName: 'Add Tag to Task',
+ description: 'Apply a tag to an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Applies an existing tag to a task, by tag gid (resolve a name with List Tags or Search Workspace Objects, or make a new tag with Create Tag). Applying a tag the task already has converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskTagChangeOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag to apply. Obtain it from List Tags or Search Workspace Objects (object type tag).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { task, tag } = context.propsValue;
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/addTag`,
+ operation: 'Add Tag to Task',
+ data: { tag: tag.trim() },
+ });
+ return { success: true, task_gid: task.trim(), tag_gid: tag.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-task-comment.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-task-comment.ts
new file mode 100644
index 00000000000..22bdbc9c4c6
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-task-comment.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaStoryOutputSchema } from '../../output-schemas';
+
+export const asanaAddTaskCommentAction = createAction({
+ auth: asanaAuth,
+ name: 'add_task_comment',
+ classification: 'WRITE',
+ displayName: 'Add Task Comment',
+ description: 'Post a comment on an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Posts a comment on a task as the connected user, in plain text or Asana rich text (one of the two), optionally pinned. Followers of the task are notified. Each call posts a new comment, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaStoryOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to comment on. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'Plain-text comment. Provide this or HTML Text, not both.',
+ required: false,
+ }),
+ html_text: Property.LongText({
+ displayName: 'HTML Text',
+ description: 'Rich-text comment in Asana rich text, wrapped in <body>...</body>, for example <body>Done, see <a href="https://example.com">the doc</a></body>. Provide this or Text, not both.',
+ required: false,
+ }),
+ is_pinned: asanaProps.optionalBoolean({
+ displayName: 'Pin Comment',
+ description: 'Yes pins the comment to the top of the task. Leave empty to post it unpinned.',
+ }),
+ },
+ async run(context) {
+ const { task, text, html_text, is_pinned } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: text, second: html_text, firstLabel: 'Text', secondLabel: 'HTML Text' });
+ if (!asanaUtils.hasValue(text) && !asanaUtils.hasValue(html_text)) {
+ throw new Error('Provide the comment in Text or HTML Text.');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/stories`,
+ operation: 'Add Task Comment',
+ query: { opt_fields: ASANA_FIELDS.story },
+ data: {
+ ...(asanaUtils.hasValue(text) ? { text } : {}),
+ ...(asanaUtils.hasValue(html_text) ? { html_text } : {}),
+ ...(is_pinned !== undefined && is_pinned !== null ? { is_pinned } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-task-followers.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-task-followers.ts
new file mode 100644
index 00000000000..97f79883d86
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-task-followers.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+export const asanaAddTaskFollowersAction = createAction({
+ auth: asanaAuth,
+ name: 'add_task_followers',
+ classification: 'WRITE',
+ displayName: 'Add Task Followers',
+ description: 'Add followers (collaborators) to an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds users as followers of a task so they get its notifications, and returns the updated task. Users already following are unaffected, so repeating the call converges and is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to add, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { task, followers } = context.propsValue;
+ const followerList = asanaUtils.toStringArray(followers);
+ if (followerList.length === 0) {
+ throw new Error('Followers must contain at least one user ("me", an email address or a user gid).');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/addFollowers`,
+ operation: 'Add Task Followers',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data: { followers: followerList },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/add-task-to-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/add-task-to-project.ts
new file mode 100644
index 00000000000..7f0b00ab9fd
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/add-task-to-project.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskProjectChangeOutputSchema } from '../../output-schemas';
+
+export const asanaAddTaskToProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'add_task_to_project',
+ classification: 'WRITE',
+ displayName: 'Add Task to Project',
+ description: 'Add an existing task to another Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds an existing task to a project (a task can live in several projects), optionally into a section or next to another task; also reorders a task already in the project. Use Move Task to Section to move it between sections of one project. Adding it again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskProjectChangeOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to add the task to. Obtain it from List Projects.',
+ required: true,
+ }),
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of a section in that project to put the task in (at the bottom). Obtain it from List Sections.',
+ required: false,
+ }),
+ insert_before: Property.ShortText({
+ displayName: 'Insert Before Task',
+ description: 'Gid of a task in the project to place this task before. Cannot be combined with Insert After Task.',
+ required: false,
+ }),
+ insert_after: Property.ShortText({
+ displayName: 'Insert After Task',
+ description: 'Gid of a task in the project to place this task after. Cannot be combined with Insert Before Task.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { task, project, section, insert_before, insert_after } = context.propsValue;
+ asanaUtils.assertNotBoth({
+ first: insert_before,
+ second: insert_after,
+ firstLabel: 'Insert Before Task',
+ secondLabel: 'Insert After Task',
+ });
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/addProject`,
+ operation: 'Add Task to Project',
+ data: {
+ project: project.trim(),
+ ...(asanaUtils.hasValue(section) ? { section: String(section).trim() } : {}),
+ ...(asanaUtils.hasValue(insert_before) ? { insert_before: String(insert_before).trim() } : {}),
+ ...(asanaUtils.hasValue(insert_after) ? { insert_after: String(insert_after).trim() } : {}),
+ },
+ });
+ return { success: true, task_gid: task.trim(), project_gid: project.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-membership.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-membership.ts
new file mode 100644
index 00000000000..95ec7556912
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-membership.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaMembershipOutputSchema } from '../../output-schemas';
+
+const ACCESS_LEVEL_OPTIONS = [
+ { label: 'Admin', value: 'admin' },
+ { label: 'Editor', value: 'editor' },
+ { label: 'Commenter', value: 'commenter' },
+ { label: 'Viewer', value: 'viewer' },
+ { label: 'User (custom fields only)', value: 'user' },
+];
+
+export const asanaCreateMembershipAction = createAction({
+ auth: asanaAuth,
+ name: 'create_membership',
+ classification: 'WRITE',
+ displayName: 'Create Membership',
+ description: 'Share a project, goal, portfolio or custom field with a user or team.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds a user or a team as a member of a project (also goals, portfolios and custom fields on paid plans) with a chosen access level, and returns the new membership. Projects accept admin, editor or commenter; goals viewer, commenter, editor or admin; portfolios admin, editor or viewer; custom fields admin, editor or user. A user must already belong to the workspace; otherwise Asana answers "Member is required". Use Add Project Members to add several users at the default level. Not idempotent: a repeat may fail or create a second record.',
+ idempotent: false,
+ },
+ outputSchema: asanaMembershipOutputSchema,
+ props: {
+ parent: Property.ShortText({
+ displayName: 'Parent GID',
+ description: 'Gid of the project (or goal, portfolio, custom field or custom type) to share. Obtain a project gid from List Projects.',
+ required: true,
+ }),
+ member: Property.ShortText({
+ displayName: 'Member GID',
+ description: 'Gid of the user or team to add. Obtain a team gid from List Teams, or a user gid from Get Current User or Search Workspace Objects.',
+ required: true,
+ }),
+ access_level: Property.StaticDropdown({
+ displayName: 'Access Level',
+ description: 'Access to grant; valid values depend on the parent type. Leave empty for the parent\'s default.',
+ required: false,
+ options: { disabled: false, options: ACCESS_LEVEL_OPTIONS },
+ }),
+ },
+ async run(context) {
+ const { parent, member, access_level } = context.propsValue;
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/memberships',
+ operation: 'Create Membership',
+ data: {
+ parent: parent.trim(),
+ member: member.trim(),
+ ...(asanaUtils.hasValue(access_level) ? { access_level } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-project-brief.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-project-brief.ts
new file mode 100644
index 00000000000..c4958744e72
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-project-brief.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectBriefOutputSchema } from '../../output-schemas';
+
+export const asanaCreateProjectBriefAction = createAction({
+ auth: asanaAuth,
+ name: 'create_project_brief',
+ classification: 'WRITE',
+ displayName: 'Create Project Brief',
+ description: 'Create the brief (overview document) of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates the project brief, the overview document shown on a project\'s Overview tab, with a title and a body in rich text (preferred) or plain text, not both; plain text is escaped and wrapped in <body> for Asana. A project has at most one brief; use Get Project to find an existing one (project_brief) and Update Project Brief to change it. Available on the free plan. Not idempotent.',
+ idempotent: false,
+ },
+ outputSchema: asanaProjectBriefOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Title of the brief, for example "Launch plan".',
+ required: false,
+ }),
+ html_text: Property.LongText({
+ displayName: 'HTML Text',
+ description: 'Body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.',
+ required: false,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'Plain-text body; it is sent to Asana as escaped rich text inside <body>...</body>. Cannot be combined with HTML Text.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { project, title, html_text, text } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: html_text, second: text, firstLabel: 'HTML Text', secondLabel: 'Text' });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/project_briefs`,
+ operation: 'Create Project Brief',
+ query: { opt_fields: ASANA_FIELDS.projectBrief },
+ data: {
+ ...(asanaUtils.hasValue(title) ? { title } : {}),
+ ...(asanaUtils.hasValue(html_text) ? { html_text } : {}),
+ ...(typeof text === 'string' && asanaUtils.hasValue(text) ? { html_text: plainTextToRichText(text) } : {}),
+ },
+ });
+ },
+});
+
+function plainTextToRichText(text: string): string {
+ const escaped = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ return `<body>${escaped}</body>`;
+}
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-project-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-project-task.ts
new file mode 100644
index 00000000000..6e12e2cdeaa
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-project-task.ts
@@ -0,0 +1,108 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+export const asanaCreateProjectTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'create_project_task',
+ classification: 'WRITE',
+ displayName: 'Create Project Task',
+ description: 'Create a task in an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new top-level task in a project, with optional description, assignee, due date or due time, start date, followers and tags (by gid or exact name; an unknown tag name fails the call instead of being dropped). Use Create Subtask to add a task under another task. Each call creates a separate task, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace that owns the project, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.',
+ required: true,
+ }),
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to create the task in. Obtain it from List Projects or Search Workspace Objects (object type project).',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Task Name',
+ description: 'Short title of the task, for example "Draft launch email".',
+ required: true,
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'Plain-text description of the task. Cannot be combined with HTML Description.',
+ required: false,
+ }),
+ html_notes: Property.LongText({
+ displayName: 'HTML Description',
+ description: 'Rich-text description in Asana rich text, wrapped in <body>...</body>, for example <body>See <strong>brief</strong></body>. Cannot be combined with Description.',
+ required: false,
+ }),
+ assignee: Property.ShortText({
+ displayName: 'Assignee',
+ description: 'User to assign: "me", an email address or a user gid.',
+ required: false,
+ }),
+ due_on: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'All-day due date in YYYY-MM-DD format, for example 2026-10-15. Cannot be combined with Due Date and Time.',
+ required: false,
+ }),
+ due_at: Property.ShortText({
+ displayName: 'Due Date and Time',
+ description: 'Exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.',
+ required: false,
+ }),
+ start_on: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Start date in YYYY-MM-DD format. Asana requires a due date or due time when a start date is set.',
+ required: false,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to add as followers, one per item: "me", an email address or a user gid.',
+ required: false,
+ }),
+ tags: Property.Array({
+ displayName: 'Tags',
+ description: 'Tags to apply, one per item: a tag gid or the exact tag name in this workspace. Names are matched case-insensitively; an all-digit value is used as a gid when such a tag exists and is otherwise matched as a name; an unknown name fails the call. Create new tags first with Create Tag.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace, project, name, notes, html_notes, assignee, due_on, due_at, start_on, followers, tags } =
+ context.propsValue;
+ asanaUtils.assertNotBoth({ first: notes, second: html_notes, firstLabel: 'Description', secondLabel: 'HTML Description' });
+ asanaUtils.assertNotBoth({ first: due_on, second: due_at, firstLabel: 'Due Date', secondLabel: 'Due Date and Time' });
+ const followerList = asanaUtils.toStringArray(followers);
+ const tagList = asanaUtils.toStringArray(tags);
+ const data: Record<string, unknown> = {
+ workspace: workspace.trim(),
+ projects: [project.trim()],
+ name,
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ ...(asanaUtils.hasValue(html_notes) ? { html_notes } : {}),
+ ...(asanaUtils.hasValue(assignee) ? { assignee: String(assignee).trim() } : {}),
+ ...(asanaUtils.hasValue(due_on) ? { due_on: asanaUtils.assertDate({ value: String(due_on), field: 'Due Date' }) } : {}),
+ ...(asanaUtils.hasValue(due_at) ? { due_at: asanaUtils.assertDateTime({ value: String(due_at), field: 'Due Date and Time' }) } : {}),
+ ...(asanaUtils.hasValue(start_on) ? { start_on: asanaUtils.assertDate({ value: String(start_on), field: 'Start Date' }) } : {}),
+ ...(followerList.length > 0 ? { followers: followerList } : {}),
+ };
+ if (tagList.length > 0) {
+ data['tags'] = await asanaClient.resolveTagGids({ auth: context.auth, workspace: workspace.trim(), tags: tagList });
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/tasks',
+ operation: 'Create Project Task',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-project.ts
new file mode 100644
index 00000000000..9cf6eff09d1
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-project.ts
@@ -0,0 +1,103 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_COLOR_OPTIONS, ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+const DEFAULT_VIEW_OPTIONS = [
+ { label: 'List', value: 'list' },
+ { label: 'Board', value: 'board' },
+ { label: 'Calendar', value: 'calendar' },
+ { label: 'Timeline', value: 'timeline' },
+];
+
+const PRIVACY_OPTIONS = [
+ { label: 'Public to workspace', value: 'public_to_workspace' },
+ { label: 'Private (members only)', value: 'private' },
+];
+
+export const asanaCreateProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'create_project',
+ classification: 'WRITE',
+ displayName: 'Create Project',
+ description: 'Create a new Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new empty project in a workspace, with optional description, color, default view, privacy and dates. In an organization a Team gid (from List Teams) is optional; without one Asana creates a teamless project visible only to its members; to copy an existing project with its tasks use Duplicate Project instead. Each call creates a separate project, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace or organization, for example 1201234567890123. Obtain it from List Workspaces.',
+ required: true,
+ }),
+ team: Property.ShortText({
+ displayName: 'Team GID',
+ description: 'Gid of the team to share the project with. Needed when the workspace is an organization; obtain it from List Teams. Asana is phasing this field out in favour of Create Membership with the team as member.',
+ required: false,
+ }),
+ name: Property.ShortText({
+ displayName: 'Project Name',
+ description: 'Name of the project, for example "Q4 Launch".',
+ required: true,
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'Plain-text description of the project.',
+ required: false,
+ }),
+ color: Property.StaticDropdown({
+ displayName: 'Color',
+ description: 'Project color. Leave empty for the default.',
+ required: false,
+ options: { disabled: false, options: ASANA_COLOR_OPTIONS },
+ }),
+ default_view: Property.StaticDropdown({
+ displayName: 'Default View',
+ description: 'View the project opens in. Leave empty for list.',
+ required: false,
+ options: { disabled: false, options: DEFAULT_VIEW_OPTIONS },
+ }),
+ privacy_setting: Property.StaticDropdown({
+ displayName: 'Privacy',
+ description: 'Who can see the project. Leave empty for the workspace default. Admins may restrict the allowed values.',
+ required: false,
+ options: { disabled: false, options: PRIVACY_OPTIONS },
+ }),
+ start_on: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Project start date in YYYY-MM-DD format. Requires a due date.',
+ required: false,
+ }),
+ due_on: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'Project due date in YYYY-MM-DD format.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace, team, name, notes, color, default_view, privacy_setting, start_on, due_on } = context.propsValue;
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/projects',
+ operation: 'Create Project',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data: {
+ workspace: workspace.trim(),
+ name,
+ ...(asanaUtils.hasValue(team) ? { team: String(team).trim() } : {}),
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ ...(asanaUtils.hasValue(color) ? { color } : {}),
+ ...(asanaUtils.hasValue(default_view) ? { default_view } : {}),
+ ...(asanaUtils.hasValue(privacy_setting) ? { privacy_setting } : {}),
+ ...(asanaUtils.hasValue(start_on) ? { start_on: asanaUtils.assertDate({ value: String(start_on), field: 'Start Date' }) } : {}),
+ ...(asanaUtils.hasValue(due_on) ? { due_on: asanaUtils.assertDate({ value: String(due_on), field: 'Due Date' }) } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-section.ts
new file mode 100644
index 00000000000..5714a0bf49a
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-section.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaSectionOutputSchema } from '../../output-schemas';
+
+export const asanaCreateSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'create_section',
+ classification: 'WRITE',
+ displayName: 'Create Section',
+ description: 'Create a section (list heading or board column) in an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new section in a project, at the end or before/after an existing section. Sections are list headings or board columns; move tasks into one with Move Task to Section. Each call creates a separate section, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaSectionOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Section Name',
+ description: 'Name of the section, for example "In review". Cannot be empty.',
+ required: true,
+ }),
+ insert_before: Property.ShortText({
+ displayName: 'Insert Before Section',
+ description: 'Gid of an existing section in this project to place the new one before. Cannot be combined with Insert After Section.',
+ required: false,
+ }),
+ insert_after: Property.ShortText({
+ displayName: 'Insert After Section',
+ description: 'Gid of an existing section in this project to place the new one after. Cannot be combined with Insert Before Section.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { project, name, insert_before, insert_after } = context.propsValue;
+ asanaUtils.assertNotBoth({
+ first: insert_before,
+ second: insert_after,
+ firstLabel: 'Insert Before Section',
+ secondLabel: 'Insert After Section',
+ });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/sections`,
+ operation: 'Create Section',
+ query: { opt_fields: ASANA_FIELDS.section },
+ data: {
+ name,
+ ...(asanaUtils.hasValue(insert_before) ? { insert_before: String(insert_before).trim() } : {}),
+ ...(asanaUtils.hasValue(insert_after) ? { insert_after: String(insert_after).trim() } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-status-update.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-status-update.ts
new file mode 100644
index 00000000000..3ed62cb48be
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-status-update.ts
@@ -0,0 +1,77 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaStatusUpdateOutputSchema } from '../../output-schemas';
+
+const STATUS_TYPE_OPTIONS = [
+ { label: 'On track', value: 'on_track' },
+ { label: 'At risk', value: 'at_risk' },
+ { label: 'Off track', value: 'off_track' },
+ { label: 'On hold (projects and portfolios)', value: 'on_hold' },
+ { label: 'Complete (projects and portfolios)', value: 'complete' },
+ { label: 'Achieved (goals)', value: 'achieved' },
+ { label: 'Partial (goals)', value: 'partial' },
+ { label: 'Missed (goals)', value: 'missed' },
+ { label: 'Dropped', value: 'dropped' },
+];
+
+export const asanaCreateStatusUpdateAction = createAction({
+ auth: asanaAuth,
+ name: 'create_status_update',
+ classification: 'WRITE',
+ displayName: 'Create Status Update',
+ description: 'Post a status update on an Asana project, portfolio or goal.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Posts a status update (status type, title, text) on a project, and on paid plans a portfolio or goal; it becomes the current status and notifies followers. Projects accept on_track, at_risk, off_track, on_hold, complete or dropped; goals on_track, at_risk, off_track, achieved, partial, missed or dropped. Each call posts a new update, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaStatusUpdateOutputSchema,
+ props: {
+ parent: Property.ShortText({
+ displayName: 'Parent GID',
+ description: 'Gid of the project (or portfolio or goal) to post on. Obtain a project gid from List Projects.',
+ required: true,
+ }),
+ status_type: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Overall status; valid values depend on the parent type.',
+ required: true,
+ options: { disabled: false, options: STATUS_TYPE_OPTIONS },
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Headline of the update, for example "Week 40: on track for launch".',
+ required: false,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'Plain-text body of the update. Required by Asana even when HTML Text is also set.',
+ required: true,
+ }),
+ html_text: Property.LongText({
+ displayName: 'HTML Text',
+ description: 'Optional rich-text body in Asana rich text, wrapped in <body>...</body>.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { parent, status_type, title, text, html_text } = context.propsValue;
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/status_updates',
+ operation: 'Create Status Update',
+ query: { opt_fields: ASANA_FIELDS.statusUpdate },
+ data: {
+ parent: parent.trim(),
+ status_type,
+ text,
+ ...(asanaUtils.hasValue(title) ? { title } : {}),
+ ...(asanaUtils.hasValue(html_text) ? { html_text } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-subtask.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-subtask.ts
new file mode 100644
index 00000000000..8e11b5e13a8
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-subtask.ts
@@ -0,0 +1,90 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+export const asanaCreateSubtaskAction = createAction({
+ auth: asanaAuth,
+ name: 'create_subtask',
+ classification: 'WRITE',
+ displayName: 'Create Subtask',
+ description: 'Create a subtask under an existing Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new subtask under a parent task, with optional description, assignee, due date or due time, start date and followers. Use Create Project Task for a top-level task in a project. Each call creates a separate subtask, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Parent Task GID',
+ description: 'Gid of the task that will contain the subtask. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Subtask Name',
+ description: 'Short title of the subtask, for example "Collect screenshots".',
+ required: true,
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'Plain-text description. Cannot be combined with HTML Description.',
+ required: false,
+ }),
+ html_notes: Property.LongText({
+ displayName: 'HTML Description',
+ description: 'Rich-text description wrapped in <body>...</body>. Cannot be combined with Description.',
+ required: false,
+ }),
+ assignee: Property.ShortText({
+ displayName: 'Assignee',
+ description: 'User to assign: "me", an email address or a user gid.',
+ required: false,
+ }),
+ due_on: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'All-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.',
+ required: false,
+ }),
+ due_at: Property.ShortText({
+ displayName: 'Due Date and Time',
+ description: 'Exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.',
+ required: false,
+ }),
+ start_on: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Start date in YYYY-MM-DD format. Requires a due date or due time.',
+ required: false,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to add as followers, one per item: "me", an email address or a user gid.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { task, name, notes, html_notes, assignee, due_on, due_at, start_on, followers } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: notes, second: html_notes, firstLabel: 'Description', secondLabel: 'HTML Description' });
+ asanaUtils.assertNotBoth({ first: due_on, second: due_at, firstLabel: 'Due Date', secondLabel: 'Due Date and Time' });
+ const followerList = asanaUtils.toStringArray(followers);
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/subtasks`,
+ operation: 'Create Subtask',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data: {
+ name,
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ ...(asanaUtils.hasValue(html_notes) ? { html_notes } : {}),
+ ...(asanaUtils.hasValue(assignee) ? { assignee: String(assignee).trim() } : {}),
+ ...(asanaUtils.hasValue(due_on) ? { due_on: asanaUtils.assertDate({ value: String(due_on), field: 'Due Date' }) } : {}),
+ ...(asanaUtils.hasValue(due_at) ? { due_at: asanaUtils.assertDateTime({ value: String(due_at), field: 'Due Date and Time' }) } : {}),
+ ...(asanaUtils.hasValue(start_on) ? { start_on: asanaUtils.assertDate({ value: String(start_on), field: 'Start Date' }) } : {}),
+ ...(followerList.length > 0 ? { followers: followerList } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/create-tag.ts b/packages/pieces/community/asana/src/lib/actions/ai/create-tag.ts
new file mode 100644
index 00000000000..0a0fa0b3316
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/create-tag.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_COLOR_OPTIONS, ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTagOutputSchema } from '../../output-schemas';
+
+export const asanaCreateTagAction = createAction({
+ auth: asanaAuth,
+ name: 'create_tag',
+ classification: 'WRITE',
+ displayName: 'Create Tag',
+ description: 'Create a tag in an Asana workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a new tag in a workspace, with optional color and description. Check List Tags or Search Workspace Objects first to reuse an existing tag instead of making a look-alike; apply it with Add Tag to Task. Each call creates a separate tag, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaTagOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Tag Name',
+ description: 'Name of the tag, for example "urgent".',
+ required: true,
+ }),
+ color: Property.StaticDropdown({
+ displayName: 'Color',
+ description: 'Tag color. Leave empty for no color.',
+ required: false,
+ options: { disabled: false, options: ASANA_COLOR_OPTIONS },
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'Optional description of what the tag means.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace, name, color, notes } = context.propsValue;
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: '/tags',
+ operation: 'Create Tag',
+ query: { opt_fields: ASANA_FIELDS.tag },
+ data: {
+ workspace: workspace.trim(),
+ name,
+ ...(asanaUtils.hasValue(color) ? { color } : {}),
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-comment.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-comment.ts
new file mode 100644
index 00000000000..654aa8ec121
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-comment.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteCommentOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteCommentAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_comment',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Comment',
+ description: 'Delete a comment from an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a comment story. Asana only lets users delete stories they created. Irreversible; repeating the call on the same comment fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteCommentOutputSchema,
+ props: {
+ story: Property.ShortText({
+ displayName: 'Comment (Story) GID',
+ description: 'Gid of the comment story. Obtain it from List Task Stories or Add Task Comment.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const story = context.propsValue.story.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/stories/${asanaUtils.pathSegment(story)}`,
+ operation: 'Delete Comment',
+ });
+ return { success: true, story_gid: story };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-membership.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-membership.ts
new file mode 100644
index 00000000000..3e1b2f72503
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-membership.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteMembershipOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteMembershipAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_membership',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Membership',
+ description: 'Revoke a user\'s or team\'s access to a project, goal or portfolio.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one membership, revoking that user\'s or team\'s access to the project, goal or portfolio. Access can only come back through a new membership. Not idempotent: repeating the call on the same membership fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteMembershipOutputSchema,
+ props: {
+ membership: Property.ShortText({
+ displayName: 'Membership GID',
+ description: 'Gid of the membership to delete. Obtain it from List Memberships.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const membership = context.propsValue.membership.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/memberships/${asanaUtils.pathSegment(membership)}`,
+ operation: 'Delete Membership',
+ });
+ return { success: true, membership_gid: membership };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-project-brief.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-project-brief.ts
new file mode 100644
index 00000000000..6e940862065
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-project-brief.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteProjectBriefOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteProjectBriefAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_project_brief',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Project Brief',
+ description: 'Delete the brief of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a project brief (the project itself is not affected). Irreversible; repeating the call on the same brief fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteProjectBriefOutputSchema,
+ props: {
+ project_brief: Property.ShortText({
+ displayName: 'Project Brief GID',
+ description: 'Gid of the project brief to delete. Obtain it from the project_brief field of Get Project.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const projectBrief = context.propsValue.project_brief.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/project_briefs/${asanaUtils.pathSegment(projectBrief)}`,
+ operation: 'Delete Project Brief',
+ });
+ return { success: true, project_brief_gid: projectBrief };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-project.ts
new file mode 100644
index 00000000000..312c3a93743
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-project.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteProjectOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_project',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Project',
+ description: 'Delete an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes a project; the API offers no restore, so treat it as permanent. Tasks that live only in this project may go with it, so move any you need first with Add Task to Project. To keep the project but hide it, use Update Project with Archived set to Yes instead. Not idempotent: repeating the call on the same project fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to delete. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const project = context.propsValue.project.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/projects/${asanaUtils.pathSegment(project)}`,
+ operation: 'Delete Project',
+ });
+ return { success: true, project_gid: project };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-section.ts
new file mode 100644
index 00000000000..3e5dffdbffc
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-section.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteSectionOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_section',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Section',
+ description: 'Delete an empty section from an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a section. Asana only deletes empty sections and never the last remaining section of a project, so move its tasks out first with Move Task to Section. Not idempotent: repeating the call on the same section fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteSectionOutputSchema,
+ props: {
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the section to delete. Obtain it from List Sections.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const section = context.propsValue.section.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/sections/${asanaUtils.pathSegment(section)}`,
+ operation: 'Delete Section',
+ });
+ return { success: true, section_gid: section };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-status-update.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-status-update.ts
new file mode 100644
index 00000000000..e31a005ad54
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-status-update.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteStatusUpdateOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteStatusUpdateAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_status_update',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Status Update',
+ description: 'Delete a status update from an Asana project, portfolio or goal.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one status update. Irreversible; repeating the call on the same update fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteStatusUpdateOutputSchema,
+ props: {
+ status_update: Property.ShortText({
+ displayName: 'Status Update GID',
+ description: 'Gid of the status update to delete. Obtain it from List Status Updates.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const statusUpdate = context.propsValue.status_update.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/status_updates/${asanaUtils.pathSegment(statusUpdate)}`,
+ operation: 'Delete Status Update',
+ });
+ return { success: true, status_update_gid: statusUpdate };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-tag.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-tag.ts
new file mode 100644
index 00000000000..b2278687766
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-tag.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteTagOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteTagAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_tag',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Tag',
+ description: 'Delete an Asana tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a tag and removes it from every task that carries it (the tasks themselves stay). To take the tag off one task only, use Remove Tag from Task. Irreversible; repeating the call on the same tag fails.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteTagOutputSchema,
+ props: {
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag to delete. Obtain it from List Tags.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const tag = context.propsValue.tag.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/tags/${asanaUtils.pathSegment(tag)}`,
+ operation: 'Delete Tag',
+ });
+ return { success: true, tag_gid: tag };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/delete-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/delete-task.ts
new file mode 100644
index 00000000000..03206929c68
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/delete-task.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaDeleteTaskOutputSchema } from '../../output-schemas';
+
+export const asanaDeleteTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'delete_task',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Task',
+ description: 'Delete an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes a task. It moves to the trash of the connected user and can be restored from the Asana app for 30 days, after which it is removed permanently. To finish a task instead, use Update Task with Completed set to Yes. Not idempotent: repeating the call on the same task may fail.',
+ idempotent: false,
+ },
+ outputSchema: asanaDeleteTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to delete. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const task = context.propsValue.task.trim();
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.DELETE,
+ path: `/tasks/${asanaUtils.pathSegment(task)}`,
+ operation: 'Delete Task',
+ });
+ return { success: true, task_gid: task };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/duplicate-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/duplicate-project.ts
new file mode 100644
index 00000000000..b6ec19f0a01
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/duplicate-project.ts
@@ -0,0 +1,72 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaJobOutputSchema } from '../../output-schemas';
+
+const INCLUDE_OPTIONS = [
+ { label: 'Members', value: 'members' },
+ { label: 'Project description (notes)', value: 'notes' },
+ { label: 'Forms', value: 'forms' },
+ { label: 'Permissions', value: 'permissions' },
+ { label: 'Allocations', value: 'allocations' },
+ { label: 'Task assignees', value: 'task_assignee' },
+ { label: 'Task attachments', value: 'task_attachments' },
+ { label: 'Task dates', value: 'task_dates' },
+ { label: 'Task dependencies', value: 'task_dependencies' },
+ { label: 'Task followers', value: 'task_followers' },
+ { label: 'Task descriptions', value: 'task_notes' },
+ { label: 'Task other projects', value: 'task_projects' },
+ { label: 'Task subtasks', value: 'task_subtasks' },
+ { label: 'Task tags', value: 'task_tags' },
+ { label: 'Task templates', value: 'task_templates' },
+ { label: 'Default task type', value: 'task_type_default' },
+];
+
+export const asanaDuplicateProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'duplicate_project',
+ classification: 'WRITE',
+ displayName: 'Duplicate Project',
+ description: 'Start copying an Asana project into a new project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts an asynchronous copy of a project (tasks, views and rules are always copied) and returns a job (gid, status, new_project). The copy may not be finished yet: poll Get Job with the returned job gid until status is succeeded. Choose extra parts with Include. Each call starts a new copy, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaJobOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to copy. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'New Project Name',
+ description: 'Name of the new project, for example "Q1 Launch".',
+ required: true,
+ }),
+ include: Property.StaticMultiSelectDropdown({
+ displayName: 'Include',
+ description: 'Optional parts to copy in addition to tasks, views and rules.',
+ required: false,
+ options: { disabled: false, options: INCLUDE_OPTIONS },
+ }),
+ },
+ async run(context) {
+ const { project, name, include } = context.propsValue;
+ const includeList = asanaUtils.toStringArray(include);
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/duplicate`,
+ operation: 'Duplicate Project',
+ query: { opt_fields: ASANA_FIELDS.job },
+ data: {
+ name,
+ ...(includeList.length > 0 ? { include: includeList.join(',') } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/duplicate-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/duplicate-task.ts
new file mode 100644
index 00000000000..082ddeb700c
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/duplicate-task.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaJobOutputSchema } from '../../output-schemas';
+
+const INCLUDE_OPTIONS = [
+ { label: 'Assignee', value: 'assignee' },
+ { label: 'Attachments', value: 'attachments' },
+ { label: 'Dates', value: 'dates' },
+ { label: 'Dependencies', value: 'dependencies' },
+ { label: 'Followers', value: 'followers' },
+ { label: 'Description (notes)', value: 'notes' },
+ { label: 'Parent task', value: 'parent' },
+ { label: 'Projects', value: 'projects' },
+ { label: 'Subtasks', value: 'subtasks' },
+ { label: 'Tags', value: 'tags' },
+];
+
+export const asanaDuplicateTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'duplicate_task',
+ classification: 'WRITE',
+ displayName: 'Duplicate Task',
+ description: 'Start copying an Asana task into a new task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts an asynchronous copy of a task and returns a job (gid, status, new_task). The copy may not be finished yet: poll Get Job with the returned job gid until status is succeeded. Choose which parts to copy with Include. Each call starts a new copy, so retries duplicate.',
+ idempotent: false,
+ },
+ outputSchema: asanaJobOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to copy. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'New Task Name',
+ description: 'Name of the new task, for example "Copy of Draft launch email".',
+ required: true,
+ }),
+ include: Property.StaticMultiSelectDropdown({
+ displayName: 'Include',
+ description: 'Parts of the original task to copy. Leave empty to copy only the name.',
+ required: false,
+ options: { disabled: false, options: INCLUDE_OPTIONS },
+ }),
+ },
+ async run(context) {
+ const { task, name, include } = context.propsValue;
+ const includeList = asanaUtils.toStringArray(include);
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/duplicate`,
+ operation: 'Duplicate Task',
+ query: { opt_fields: ASANA_FIELDS.job },
+ data: {
+ name,
+ ...(includeList.length > 0 ? { include: includeList.join(',') } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-current-user.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-current-user.ts
new file mode 100644
index 00000000000..4da6cc1913d
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-current-user.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient } from '../../common/client';
+import { asanaCurrentUserOutputSchema } from '../../output-schemas';
+
+export const asanaGetCurrentUserAction = createAction({
+ auth: asanaAuth,
+ name: 'get_current_user',
+ classification: 'READ',
+ displayName: 'Get Current User',
+ description: 'Get the Asana user behind this connection.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the connected Asana user (gid, name, email) and the workspaces they belong to. Call it first to learn your own user gid and the workspace gids other actions need; "me" also works wherever a user is expected. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaCurrentUserOutputSchema,
+ props: {},
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: '/users/me',
+ operation: 'Get Current User',
+ query: { opt_fields: ASANA_FIELDS.user },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-job.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-job.ts
new file mode 100644
index 00000000000..46bd2cb9f62
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-job.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaJobOutputSchema } from '../../output-schemas';
+
+export const asanaGetJobAction = createAction({
+ auth: asanaAuth,
+ name: 'get_job',
+ classification: 'READ',
+ displayName: 'Get Job',
+ description: 'Check the status of an asynchronous Asana job.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the current status of an asynchronous job started by Duplicate Task or Duplicate Project: not_started, in_progress, succeeded or failed, plus the new_task or new_project it produced. A single status read, not a wait; call it again later while the job is still running. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaJobOutputSchema,
+ props: {
+ job: Property.ShortText({
+ displayName: 'Job GID',
+ description: 'Gid of the job returned by Duplicate Task or Duplicate Project.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/jobs/${asanaUtils.pathSegment(context.propsValue.job)}`,
+ operation: 'Get Job',
+ query: { opt_fields: ASANA_FIELDS.job },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-membership.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-membership.ts
new file mode 100644
index 00000000000..8a3ed5c9735
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-membership.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaMembershipOutputSchema } from '../../output-schemas';
+
+export const asanaGetMembershipAction = createAction({
+ auth: asanaAuth,
+ name: 'get_membership',
+ classification: 'READ',
+ displayName: 'Get Membership',
+ description: 'Get one membership of a project, goal or portfolio.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one membership by gid: the member (user or team), the parent (project, goal, portfolio or custom field) and the access level. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaMembershipOutputSchema,
+ props: {
+ membership: Property.ShortText({
+ displayName: 'Membership GID',
+ description: 'Gid of the membership. Obtain it from List Memberships or Create Membership.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/memberships/${asanaUtils.pathSegment(context.propsValue.membership)}`,
+ operation: 'Get Membership',
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-project-brief.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-project-brief.ts
new file mode 100644
index 00000000000..54929efa904
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-project-brief.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectBriefOutputSchema } from '../../output-schemas';
+
+export const asanaGetProjectBriefAction = createAction({
+ auth: asanaAuth,
+ name: 'get_project_brief',
+ classification: 'READ',
+ displayName: 'Get Project Brief',
+ description: 'Get the brief (overview document) of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one project brief by gid with its title, plain text, rich text, project and link. The brief gid is the project_brief field of Get Project. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectBriefOutputSchema,
+ props: {
+ project_brief: Property.ShortText({
+ displayName: 'Project Brief GID',
+ description: 'Gid of the project brief. Obtain it from the project_brief field of Get Project, or from Create Project Brief.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/project_briefs/${asanaUtils.pathSegment(context.propsValue.project_brief)}`,
+ operation: 'Get Project Brief',
+ query: { opt_fields: ASANA_FIELDS.projectBrief },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-project-task-counts.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-project-task-counts.ts
new file mode 100644
index 00000000000..8843fcc19df
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-project-task-counts.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectTaskCountsOutputSchema } from '../../output-schemas';
+
+export const asanaGetProjectTaskCountsAction = createAction({
+ auth: asanaAuth,
+ name: 'get_project_task_counts',
+ classification: 'READ',
+ displayName: 'Get Project Task Counts',
+ description: 'Get the number of total, completed and open tasks and milestones in a project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns task and milestone totals for one project (total, completed, incomplete). Use it for progress summaries instead of paging through List Project Tasks. Asana rate-limits this endpoint more strictly, so avoid calling it in tight loops. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectTaskCountsOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const project = context.propsValue.project.trim();
+ const counts = await asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/projects/${asanaUtils.pathSegment(project)}/task_counts`,
+ operation: 'Get Project Task Counts',
+ query: { opt_fields: ASANA_FIELDS.taskCounts },
+ });
+ return { project_gid: project, ...counts };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-project.ts
new file mode 100644
index 00000000000..fe64fa37adb
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-project.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+export const asanaGetProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'get_project',
+ classification: 'READ',
+ displayName: 'Get Project',
+ description: 'Get the details of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one project by gid with its name, description, archived and completed state, dates, owner, team, privacy, latest status update, members, followers and link. Use Get Project Task Counts for task totals. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects (object type project).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/projects/${asanaUtils.pathSegment(context.propsValue.project)}`,
+ operation: 'Get Project',
+ query: { opt_fields: ASANA_FIELDS.project },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-section.ts
new file mode 100644
index 00000000000..7373e3b86e6
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-section.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaSectionOutputSchema } from '../../output-schemas';
+
+export const asanaGetSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'get_section',
+ classification: 'READ',
+ displayName: 'Get Section',
+ description: 'Get the details of an Asana section.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one section by gid with its name, creation time and project. Use List Section Tasks for its tasks. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaSectionOutputSchema,
+ props: {
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the section. Obtain it from List Sections.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/sections/${asanaUtils.pathSegment(context.propsValue.section)}`,
+ operation: 'Get Section',
+ query: { opt_fields: ASANA_FIELDS.section },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-status-update.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-status-update.ts
new file mode 100644
index 00000000000..0f94c221cf3
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-status-update.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaStatusUpdateOutputSchema } from '../../output-schemas';
+
+export const asanaGetStatusUpdateAction = createAction({
+ auth: asanaAuth,
+ name: 'get_status_update',
+ classification: 'READ',
+ displayName: 'Get Status Update',
+ description: 'Get one status update of an Asana project, portfolio or goal.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one status update by gid with its status type, title, text, author, parent and timestamps. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaStatusUpdateOutputSchema,
+ props: {
+ status_update: Property.ShortText({
+ displayName: 'Status Update GID',
+ description: 'Gid of the status update. Obtain it from List Status Updates or Create Status Update.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/status_updates/${asanaUtils.pathSegment(context.propsValue.status_update)}`,
+ operation: 'Get Status Update',
+ query: { opt_fields: ASANA_FIELDS.statusUpdate },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-story.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-story.ts
new file mode 100644
index 00000000000..1684f449023
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-story.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaStoryOutputSchema } from '../../output-schemas';
+
+export const asanaGetStoryAction = createAction({
+ auth: asanaAuth,
+ name: 'get_story',
+ classification: 'READ',
+ displayName: 'Get Story',
+ description: 'Get one comment or activity entry of an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one story (a comment or a system activity entry) by gid, including its text, rich text, author, pin state and whether it can be edited. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaStoryOutputSchema,
+ props: {
+ story: Property.ShortText({
+ displayName: 'Story GID',
+ description: 'Gid of the story. Obtain it from List Task Stories or Add Task Comment.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/stories/${asanaUtils.pathSegment(context.propsValue.story)}`,
+ operation: 'Get Story',
+ query: { opt_fields: ASANA_FIELDS.story },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-tag.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-tag.ts
new file mode 100644
index 00000000000..ca62b2db62e
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-tag.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTagOutputSchema } from '../../output-schemas';
+
+export const asanaGetTagAction = createAction({
+ auth: asanaAuth,
+ name: 'get_tag',
+ classification: 'READ',
+ displayName: 'Get Tag',
+ description: 'Get the details of an Asana tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one tag by gid with its name, color, description, followers, workspace and link. Use List Tag Tasks for the tasks carrying it. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTagOutputSchema,
+ props: {
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag. Obtain it from List Tags, List Task Tags or Search Workspace Objects (object type tag).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/tags/${asanaUtils.pathSegment(context.propsValue.tag)}`,
+ operation: 'Get Tag',
+ query: { opt_fields: ASANA_FIELDS.tag },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/get-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/get-task.ts
new file mode 100644
index 00000000000..80c0648a2cb
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/get-task.ts
@@ -0,0 +1,36 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaGetTaskOutputSchema } from '../../output-schemas';
+
+export const asanaGetTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'get_task',
+ classification: 'READ',
+ displayName: 'Get Task',
+ description: 'Get the details of an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one task by gid with its name, description, completion, dates, assignee, parent, projects and sections, tags, followers and link. Use it to read the current state before Update Task, or to inspect a task found by a list or search action. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaGetTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task, for example 1204567890123456. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/tasks/${asanaUtils.pathSegment(context.propsValue.task)}`,
+ operation: 'Get Task',
+ query: { opt_fields: ASANA_FIELDS.task },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-assigned-tasks.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-assigned-tasks.ts
new file mode 100644
index 00000000000..4c6c762e02c
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-assigned-tasks.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskListOutputSchema } from '../../output-schemas';
+
+export const asanaListAssignedTasksAction = createAction({
+ auth: asanaAuth,
+ name: 'list_assigned_tasks',
+ classification: 'SEARCH',
+ displayName: 'List Assigned Tasks',
+ description: 'List the tasks assigned to a user in a workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists tasks assigned to one user (use "me" for the connected user\'s My Tasks) in a workspace, optionally only incomplete ones or ones changed since a moment. Use List Project Tasks for a project\'s tasks instead. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskListOutputSchema,
+ props: {
+ assignee: Property.ShortText({
+ displayName: 'Assignee',
+ description: '"me", an email address or a user gid.',
+ required: true,
+ defaultValue: 'me',
+ }),
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.',
+ required: true,
+ }),
+ completed_since: Property.ShortText({
+ displayName: 'Completed Since',
+ description: 'Return incomplete tasks plus tasks completed after this ISO 8601 date-time. Use "now" to return only incomplete tasks. Leave empty to return all tasks.',
+ required: false,
+ }),
+ modified_since: Property.ShortText({
+ displayName: 'Modified Since',
+ description: 'Only return tasks changed after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.',
+ required: false,
+ }),
+ limit: asanaProps.limit({ noun: 'tasks' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { assignee, workspace, completed_since, modified_since, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/tasks',
+ operation: 'List Assigned Tasks',
+ query: {
+ assignee: assignee.trim(),
+ workspace: workspace.trim(),
+ completed_since: asanaUtils.hasValue(completed_since) ? String(completed_since).trim() : undefined,
+ modified_since: asanaUtils.hasValue(modified_since) ? String(modified_since).trim() : undefined,
+ opt_fields: ASANA_FIELDS.taskList,
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-memberships.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-memberships.ts
new file mode 100644
index 00000000000..5f7b34ac821
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-memberships.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaMembershipListOutputSchema } from '../../output-schemas';
+
+export const asanaListMembershipsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_memberships',
+ classification: 'SEARCH',
+ displayName: 'List Memberships',
+ description: 'List who has access to a project, goal or portfolio, or which projects a team is in.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists memberships with their access levels. Pass a Parent (project, goal or portfolio gid) to see its members, optionally filtered to one Member; or pass only a team as Member to list the projects shared with that team. Use it to find the membership gid for Delete Membership. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaMembershipListOutputSchema,
+ props: {
+ parent: Property.ShortText({
+ displayName: 'Parent GID',
+ description: 'Gid of the project, goal or portfolio whose members to list. Leave empty only when Member is a team.',
+ required: false,
+ }),
+ member: Property.ShortText({
+ displayName: 'Member GID',
+ description: 'Gid of a user or team to filter on. Required (and must be a team) when Parent is empty.',
+ required: false,
+ }),
+ limit: asanaProps.limit({ noun: 'memberships' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { parent, member, limit, offset } = context.propsValue;
+ const hasParent = asanaUtils.hasValue(parent);
+ if (!hasParent && !asanaUtils.hasValue(member)) {
+ throw new Error('Set Parent (a project, goal or portfolio gid), or set Member to a team gid to list that team\'s projects.');
+ }
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/memberships',
+ operation: 'List Memberships',
+ query: {
+ parent: hasParent ? String(parent).trim() : undefined,
+ member: asanaUtils.hasValue(member) ? String(member).trim() : undefined,
+ resource_subtype: hasParent ? undefined : 'project_membership',
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-project-tasks.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-project-tasks.ts
new file mode 100644
index 00000000000..60277c2e335
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-project-tasks.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskListOutputSchema } from '../../output-schemas';
+
+export const asanaListProjectTasksAction = createAction({
+ auth: asanaAuth,
+ name: 'list_project_tasks',
+ classification: 'SEARCH',
+ displayName: 'List Project Tasks',
+ description: 'List the tasks in an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the tasks of one project in project order, optionally only incomplete ones. This is the free-plan way to browse tasks; use List Section Tasks for one board column or List Assigned Tasks for one person. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskListOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects (object type project).',
+ required: true,
+ }),
+ completed_since: Property.ShortText({
+ displayName: 'Completed Since',
+ description: 'Return incomplete tasks plus tasks completed after this ISO 8601 date-time. Use "now" to return only incomplete tasks. Leave empty to return all tasks.',
+ required: false,
+ }),
+ limit: asanaProps.limit({ noun: 'tasks' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { project, completed_since, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/projects/${asanaUtils.pathSegment(project)}/tasks`,
+ operation: 'List Project Tasks',
+ query: {
+ completed_since: asanaUtils.hasValue(completed_since) ? String(completed_since).trim() : undefined,
+ opt_fields: ASANA_FIELDS.taskList,
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-projects.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-projects.ts
new file mode 100644
index 00000000000..ab928e27a34
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-projects.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps } from '../../common/client';
+import { asanaProjectListOutputSchema } from '../../output-schemas';
+
+export const asanaListProjectsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_projects',
+ classification: 'SEARCH',
+ displayName: 'List Projects',
+ description: 'List the projects in an Asana workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the projects in a workspace that the connected user can see, optionally only archived or only active ones. Use Search Workspace Objects to find a project by name, or List Memberships with a team to list a team\'s projects. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectListOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace or organization, for example 1201234567890123. Obtain it from List Workspaces.',
+ required: true,
+ }),
+ archived: asanaProps.optionalBoolean({
+ displayName: 'Archived',
+ description: 'Yes returns only archived projects, No only active ones. Leave empty to return both.',
+ }),
+ limit: asanaProps.limit({ noun: 'projects' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { workspace, archived, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/projects',
+ operation: 'List Projects',
+ query: {
+ workspace: workspace.trim(),
+ archived: archived === undefined || archived === null ? undefined : archived,
+ opt_fields: ASANA_FIELDS.projectList,
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-section-tasks.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-section-tasks.ts
new file mode 100644
index 00000000000..7fda4df31d5
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-section-tasks.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskListOutputSchema } from '../../output-schemas';
+
+export const asanaListSectionTasksAction = createAction({
+ auth: asanaAuth,
+ name: 'list_section_tasks',
+ classification: 'SEARCH',
+ displayName: 'List Section Tasks',
+ description: 'List the tasks in one section of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the tasks in one section (board column or list heading), optionally only incomplete ones. Asana documents this endpoint for board-view projects; if it returns nothing for a list-view project, use List Project Tasks instead. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskListOutputSchema,
+ props: {
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the section. Obtain it from List Sections.',
+ required: true,
+ }),
+ completed_since: Property.ShortText({
+ displayName: 'Completed Since',
+ description: 'Return incomplete tasks plus tasks completed after this ISO 8601 date-time. Use "now" to return only incomplete tasks. Leave empty to return all tasks.',
+ required: false,
+ }),
+ limit: asanaProps.limit({ noun: 'tasks' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { section, completed_since, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/sections/${asanaUtils.pathSegment(section)}/tasks`,
+ operation: 'List Section Tasks',
+ query: {
+ completed_since: asanaUtils.hasValue(completed_since) ? String(completed_since).trim() : undefined,
+ opt_fields: ASANA_FIELDS.taskList,
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-sections.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-sections.ts
new file mode 100644
index 00000000000..2c4df4a13df
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-sections.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaSectionListOutputSchema } from '../../output-schemas';
+
+export const asanaListSectionsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_sections',
+ classification: 'SEARCH',
+ displayName: 'List Sections',
+ description: 'List the sections of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the sections (list headings or board columns) of a project in display order. Use it to find the section gid for Move Task to Section, List Section Tasks or Move Section. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaSectionListOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'sections' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { project, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/projects/${asanaUtils.pathSegment(project)}/sections`,
+ operation: 'List Sections',
+ query: { opt_fields: ASANA_FIELDS.section },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-status-updates.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-status-updates.ts
new file mode 100644
index 00000000000..a34e58e40f9
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-status-updates.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaStatusUpdateListOutputSchema } from '../../output-schemas';
+
+export const asanaListStatusUpdatesAction = createAction({
+ auth: asanaAuth,
+ name: 'list_status_updates',
+ classification: 'SEARCH',
+ displayName: 'List Status Updates',
+ description: 'List the status updates of an Asana project, portfolio or goal.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the status updates posted on a project (or portfolio or goal), optionally only those created after a moment. Use it to review project health over time. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaStatusUpdateListOutputSchema,
+ props: {
+ parent: Property.ShortText({
+ displayName: 'Parent GID',
+ description: 'Gid of the project, portfolio or goal. Obtain a project gid from List Projects.',
+ required: true,
+ }),
+ created_since: Property.ShortText({
+ displayName: 'Created Since',
+ description: 'Only return updates created after this ISO 8601 date-time, for example 2026-09-01T00:00:00Z.',
+ required: false,
+ }),
+ limit: asanaProps.limit({ noun: 'status updates' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { parent, created_since, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/status_updates',
+ operation: 'List Status Updates',
+ query: {
+ parent: parent.trim(),
+ created_since: asanaUtils.hasValue(created_since) ? String(created_since).trim() : undefined,
+ opt_fields: ASANA_FIELDS.statusUpdate,
+ },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-subtasks.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-subtasks.ts
new file mode 100644
index 00000000000..949153ebbf3
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-subtasks.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskListOutputSchema } from '../../output-schemas';
+
+export const asanaListSubtasksAction = createAction({
+ auth: asanaAuth,
+ name: 'list_subtasks',
+ classification: 'SEARCH',
+ displayName: 'List Subtasks',
+ description: 'List the subtasks of an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the direct subtasks of one task (one level deep; call again on a subtask for deeper levels). Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskListOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Parent Task GID',
+ description: 'Gid of the parent task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'subtasks' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { task, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/subtasks`,
+ operation: 'List Subtasks',
+ query: { opt_fields: ASANA_FIELDS.taskList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-tag-tasks.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-tag-tasks.ts
new file mode 100644
index 00000000000..aa8ef1749ba
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-tag-tasks.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskListOutputSchema } from '../../output-schemas';
+
+export const asanaListTagTasksAction = createAction({
+ auth: asanaAuth,
+ name: 'list_tag_tasks',
+ classification: 'SEARCH',
+ displayName: 'List Tag Tasks',
+ description: 'List the tasks that carry an Asana tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the tasks carrying one tag, across all projects of the workspace. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskListOutputSchema,
+ props: {
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag. Obtain it from List Tags or Search Workspace Objects (object type tag).',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'tasks' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { tag, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/tags/${asanaUtils.pathSegment(tag)}/tasks`,
+ operation: 'List Tag Tasks',
+ query: { opt_fields: ASANA_FIELDS.taskList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-tags.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-tags.ts
new file mode 100644
index 00000000000..e998bdbd74e
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-tags.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps } from '../../common/client';
+import { asanaTagListOutputSchema } from '../../output-schemas';
+
+export const asanaListTagsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_tags',
+ classification: 'SEARCH',
+ displayName: 'List Tags',
+ description: 'List the tags in an Asana workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the tags of a workspace with their gid, name and color. Use it to find a tag gid for Add Tag to Task or List Tag Tasks; Search Workspace Objects finds one tag by name faster. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTagListOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace, for example 1201234567890123. Obtain it from List Workspaces.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'tags' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { workspace, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/tags',
+ operation: 'List Tags',
+ query: { workspace: workspace.trim(), opt_fields: ASANA_FIELDS.tagList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-task-projects.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-task-projects.ts
new file mode 100644
index 00000000000..106953ec92f
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-task-projects.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaProjectListOutputSchema } from '../../output-schemas';
+
+export const asanaListTaskProjectsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_task_projects',
+ classification: 'SEARCH',
+ displayName: 'List Task Projects',
+ description: 'List the projects an Asana task belongs to.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the projects a task is directly in (a task can be in several). Use it before Remove Task from Project or to find where a task lives. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectListOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'projects' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { task, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/projects`,
+ operation: 'List Task Projects',
+ query: { opt_fields: ASANA_FIELDS.projectList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-task-stories.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-task-stories.ts
new file mode 100644
index 00000000000..6a6f3a95a8c
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-task-stories.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaStoryListOutputSchema } from '../../output-schemas';
+
+export const asanaListTaskStoriesAction = createAction({
+ auth: asanaAuth,
+ name: 'list_task_stories',
+ classification: 'SEARCH',
+ displayName: 'List Task Stories',
+ description: 'List the comments and activity of an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the stories of a task, oldest first: comments (resource_subtype comment_added) plus system activity such as assignments and due-date changes. Use it to read the comment thread or to find a comment gid for Update Comment or Delete Comment. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaStoryListOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'stories' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { task, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/stories`,
+ operation: 'List Task Stories',
+ query: { opt_fields: ASANA_FIELDS.storyList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-task-tags.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-task-tags.ts
new file mode 100644
index 00000000000..83766c7a7ed
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-task-tags.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTagListOutputSchema } from '../../output-schemas';
+
+export const asanaListTaskTagsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_task_tags',
+ classification: 'SEARCH',
+ displayName: 'List Task Tags',
+ description: 'List the tags on an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the tags currently applied to one task. Use it before Remove Tag from Task. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTagListOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'tags' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { task, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/tags`,
+ operation: 'List Task Tags',
+ query: { opt_fields: ASANA_FIELDS.tagList },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-teams.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-teams.ts
new file mode 100644
index 00000000000..d67d4b01e8f
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-teams.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTeamListOutputSchema } from '../../output-schemas';
+
+export const asanaListTeamsAction = createAction({
+ auth: asanaAuth,
+ name: 'list_teams',
+ classification: 'SEARCH',
+ displayName: 'List Teams',
+ description: 'List the teams in an Asana organization.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the teams in an organization that the connected user can see. Teams exist only in organizations (company-domain workspaces); a plain workspace returns an error. Use it to find the team gid Create Project needs in an organization. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTeamListOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Organization (Workspace) GID',
+ description: 'Gid of the organization, for example 1201234567890123. Obtain it from List Workspaces (is_organization must be true).',
+ required: true,
+ }),
+ limit: asanaProps.limit({ noun: 'teams' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { workspace, limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: `/workspaces/${asanaUtils.pathSegment(workspace)}/teams`,
+ operation: 'List Teams',
+ query: { opt_fields: ASANA_FIELDS.team },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/list-workspaces.ts b/packages/pieces/community/asana/src/lib/actions/ai/list-workspaces.ts
new file mode 100644
index 00000000000..9ed4b3d3ac9
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/list-workspaces.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps } from '../../common/client';
+import { asanaWorkspaceListOutputSchema } from '../../output-schemas';
+
+export const asanaListWorkspacesAction = createAction({
+ auth: asanaAuth,
+ name: 'list_workspaces',
+ classification: 'SEARCH',
+ displayName: 'List Workspaces',
+ description: 'List the workspaces and organizations the connected user can access.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the workspaces and organizations visible to the connected user, with is_organization (teams exist only in organizations). Use it to find the workspace gid that projects, tags, typeahead search and assigned-task listing require. Paginated with next_offset; read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaWorkspaceListOutputSchema,
+ props: {
+ limit: asanaProps.limit({ noun: 'workspaces' }),
+ offset: asanaProps.offset(),
+ },
+ async run(context) {
+ const { limit, offset } = context.propsValue;
+ return asanaClient.asanaListPage<AsanaRecord>({
+ auth: context.auth,
+ path: '/workspaces',
+ operation: 'List Workspaces',
+ query: { opt_fields: ASANA_FIELDS.workspace },
+ limit,
+ offset,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/move-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/move-section.ts
new file mode 100644
index 00000000000..a75dc6f04a0
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/move-section.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaMoveSectionOutputSchema } from '../../output-schemas';
+
+export const asanaMoveSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'move_section',
+ classification: 'WRITE',
+ displayName: 'Move Section',
+ description: 'Reorder a section within its Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Moves a section immediately before or after another section of the same project (exactly one of the two). Sections cannot move between projects. Repeating the same move converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaMoveSectionOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project both sections belong to. Obtain it from List Projects.',
+ required: true,
+ }),
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the section to move. Obtain it from List Sections.',
+ required: true,
+ }),
+ before_section: Property.ShortText({
+ displayName: 'Before Section',
+ description: 'Gid of the section to place it immediately before. Provide this or After Section.',
+ required: false,
+ }),
+ after_section: Property.ShortText({
+ displayName: 'After Section',
+ description: 'Gid of the section to place it immediately after. Provide this or Before Section.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { project, section, before_section, after_section } = context.propsValue;
+ asanaUtils.assertNotBoth({
+ first: before_section,
+ second: after_section,
+ firstLabel: 'Before Section',
+ secondLabel: 'After Section',
+ });
+ if (!asanaUtils.hasValue(before_section) && !asanaUtils.hasValue(after_section)) {
+ throw new Error('Set Before Section or After Section to say where the section goes.');
+ }
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/sections/insert`,
+ operation: 'Move Section',
+ data: {
+ section: section.trim(),
+ ...(asanaUtils.hasValue(before_section) ? { before_section: String(before_section).trim() } : {}),
+ ...(asanaUtils.hasValue(after_section) ? { after_section: String(after_section).trim() } : {}),
+ },
+ });
+ return { success: true, project_gid: project.trim(), section_gid: section.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/move-task-to-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/move-task-to-section.ts
new file mode 100644
index 00000000000..6e17291cabc
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/move-task-to-section.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaMoveTaskToSectionOutputSchema } from '../../output-schemas';
+
+export const asanaMoveTaskToSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'move_task_to_section',
+ classification: 'WRITE',
+ displayName: 'Move Task to Section',
+ description: 'Move a task into a section of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Puts a task into a section (list heading or board column), removing it from its other sections in that project; it goes to the top unless you place it before or after another task. Use Add Task to Project to put a task into another project. Repeating the same move converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaMoveTaskToSectionOutputSchema,
+ props: {
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the target section. Obtain it from List Sections.',
+ required: true,
+ }),
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to move. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ insert_before: Property.ShortText({
+ displayName: 'Insert Before Task',
+ description: 'Gid of a task in the section to place this task before. Cannot be combined with Insert After Task.',
+ required: false,
+ }),
+ insert_after: Property.ShortText({
+ displayName: 'Insert After Task',
+ description: 'Gid of a task in the section to place this task after. Cannot be combined with Insert Before Task.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { section, task, insert_before, insert_after } = context.propsValue;
+ asanaUtils.assertNotBoth({
+ first: insert_before,
+ second: insert_after,
+ firstLabel: 'Insert Before Task',
+ secondLabel: 'Insert After Task',
+ });
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/sections/${asanaUtils.pathSegment(section)}/addTask`,
+ operation: 'Move Task to Section',
+ data: {
+ task: task.trim(),
+ ...(asanaUtils.hasValue(insert_before) ? { insert_before: String(insert_before).trim() } : {}),
+ ...(asanaUtils.hasValue(insert_after) ? { insert_after: String(insert_after).trim() } : {}),
+ },
+ });
+ return { success: true, section_gid: section.trim(), task_gid: task.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/remove-project-followers.ts b/packages/pieces/community/asana/src/lib/actions/ai/remove-project-followers.ts
new file mode 100644
index 00000000000..19f1be94fc5
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/remove-project-followers.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+export const asanaRemoveProjectFollowersAction = createAction({
+ auth: asanaAuth,
+ name: 'remove_project_followers',
+ classification: 'WRITE',
+ displayName: 'Remove Project Followers',
+ description: 'Unsubscribe users from "task added" notifications of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Removes users from the followers of a project so they stop getting "task added" notifications, and returns the updated project. Their membership is not affected (use Remove Project Members for that). Users not following are ignored, so repeating the call converges and is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to remove, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { project, followers } = context.propsValue;
+ const followerList = asanaUtils.toStringArray(followers);
+ if (followerList.length === 0) {
+ throw new Error('Followers must contain at least one user ("me", an email address or a user gid).');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/removeFollowers`,
+ operation: 'Remove Project Followers',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data: { followers: followerList.join(',') },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/remove-project-members.ts b/packages/pieces/community/asana/src/lib/actions/ai/remove-project-members.ts
new file mode 100644
index 00000000000..6d01d567072
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/remove-project-members.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaAuth, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+export const asanaRemoveProjectMembersAction = createAction({
+ auth: asanaAuth,
+ name: 'remove_project_members',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Remove Project Members',
+ description: 'Revoke users\' membership of an Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Removes users from the members of a project, revoking the access that membership gave them (a private project becomes invisible to them), and returns the updated project. Use Remove Project Followers to only stop notifications. Users who are not members are ignored, so repeating the call converges.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ members: Property.Array({
+ displayName: 'Members',
+ description: 'Users to remove, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { project, members } = context.propsValue;
+ const memberList = asanaUtils.toStringArray(members);
+ if (memberList.length === 0) {
+ throw new Error('Members must contain at least one user ("me", an email address or a user gid).');
+ }
+ const memberGids = await Promise.all(
+ memberList.map((member) => toUserGid({ auth: context.auth, member })),
+ );
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/projects/${asanaUtils.pathSegment(project)}/removeMembers`,
+ operation: 'Remove Project Members',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data: { members: memberGids.join(',') },
+ });
+ },
+});
+
+async function toUserGid({ auth, member }: { auth: AsanaAuth; member: string }): Promise<string> {
+ if (/^\d+$/.test(member)) {
+ return member;
+ }
+ const user = await asanaClient.asanaData<AsanaRecord>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/users/${asanaUtils.pathSegment(member)}`,
+ operation: 'Remove Project Members',
+ query: { opt_fields: 'gid' },
+ });
+ return String(user['gid']);
+}
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/remove-tag-from-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/remove-tag-from-task.ts
new file mode 100644
index 00000000000..c38eaa81b1e
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/remove-tag-from-task.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskTagChangeOutputSchema } from '../../output-schemas';
+
+export const asanaRemoveTagFromTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'remove_tag_from_task',
+ classification: 'WRITE',
+ displayName: 'Remove Tag from Task',
+ description: 'Take a tag off an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Removes one tag from one task; the tag itself and its other tasks are unaffected (use Delete Tag to delete the tag everywhere). Removing a tag the task does not have converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskTagChangeOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag to remove. Obtain it from List Task Tags.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { task, tag } = context.propsValue;
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/removeTag`,
+ operation: 'Remove Tag from Task',
+ data: { tag: tag.trim() },
+ });
+ return { success: true, task_gid: task.trim(), tag_gid: tag.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/remove-task-followers.ts b/packages/pieces/community/asana/src/lib/actions/ai/remove-task-followers.ts
new file mode 100644
index 00000000000..16683159991
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/remove-task-followers.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+export const asanaRemoveTaskFollowersAction = createAction({
+ auth: asanaAuth,
+ name: 'remove_task_followers',
+ classification: 'WRITE',
+ displayName: 'Remove Task Followers',
+ description: 'Remove followers from an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Removes users from the followers of a task so they stop getting its notifications, and returns the updated task. Users not following are ignored, so repeating the call converges and is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ followers: Property.Array({
+ displayName: 'Followers',
+ description: 'Users to remove, one per item: "me", an email address or a user gid.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { task, followers } = context.propsValue;
+ const followerList = asanaUtils.toStringArray(followers);
+ if (followerList.length === 0) {
+ throw new Error('Followers must contain at least one user ("me", an email address or a user gid).');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/removeFollowers`,
+ operation: 'Remove Task Followers',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data: { followers: followerList },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/remove-task-from-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/remove-task-from-project.ts
new file mode 100644
index 00000000000..163af0c42f5
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/remove-task-from-project.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskProjectChangeOutputSchema } from '../../output-schemas';
+
+export const asanaRemoveTaskFromProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'remove_task_from_project',
+ classification: 'WRITE',
+ displayName: 'Remove Task from Project',
+ description: 'Remove a task from one of its Asana projects.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Removes a task from one project without deleting it; the task stays in its other projects (or becomes project-less) and can be added back with Add Task to Project, though its section position is lost. Use Delete Task to delete it. Removing it again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskProjectChangeOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to remove the task from. Obtain it from List Task Projects.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { task, project } = context.propsValue;
+ await asanaClient.asanaEmpty({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/removeProject`,
+ operation: 'Remove Task from Project',
+ data: { project: project.trim() },
+ });
+ return { success: true, task_gid: task.trim(), project_gid: project.trim() };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/search-workspace-objects.ts b/packages/pieces/community/asana/src/lib/actions/ai/search-workspace-objects.ts
new file mode 100644
index 00000000000..3301458602d
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/search-workspace-objects.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaSearchWorkspaceObjectsOutputSchema } from '../../output-schemas';
+
+const RESOURCE_TYPE_OPTIONS = [
+ { label: 'Task', value: 'task' },
+ { label: 'Project', value: 'project' },
+ { label: 'User', value: 'user' },
+ { label: 'Tag', value: 'tag' },
+ { label: 'Team', value: 'team' },
+ { label: 'Portfolio', value: 'portfolio' },
+ { label: 'Goal', value: 'goal' },
+ { label: 'Custom field', value: 'custom_field' },
+ { label: 'Project template', value: 'project_template' },
+];
+
+export const asanaSearchWorkspaceObjectsAction = createAction({
+ auth: asanaAuth,
+ name: 'search_workspace_objects',
+ classification: 'SEARCH',
+ displayName: 'Search Workspace Objects',
+ description: 'Find tasks, projects, users, tags or teams by name in a workspace.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Name-based typeahead lookup in one workspace: returns the gid and name of matching tasks, projects, users, tags, teams and more. Use it to turn a name into the gid other actions need; it works on free plans. Results are fuzzy and capped at one page (up to 100), with no pagination. Read-only and safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaSearchWorkspaceObjectsOutputSchema,
+ props: {
+ workspace: Property.ShortText({
+ displayName: 'Workspace GID',
+ description: 'Gid of the workspace to search, for example 1201234567890123. Obtain it from List Workspaces or Get Current User.',
+ required: true,
+ }),
+ resource_type: Property.StaticDropdown({
+ displayName: 'Object Type',
+ description: 'Which kind of object to return.',
+ required: true,
+ options: { disabled: false, options: RESOURCE_TYPE_OPTIONS },
+ }),
+ query: Property.ShortText({
+ displayName: 'Query',
+ description: 'Text to match against object names, for example "Q4 launch". Leave empty to get recently relevant objects of this type.',
+ required: false,
+ }),
+ count: Property.Number({
+ displayName: 'Count',
+ description: 'Number of results to return, from 1 to 100. Defaults to 20.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { workspace, resource_type, query, count } = context.propsValue;
+ if (asanaUtils.hasValue(count) && (!Number.isInteger(count) || Number(count) < 1 || Number(count) > 100)) {
+ throw new Error(`Count must be a whole number between 1 and 100, got ${count}.`);
+ }
+ const data = await asanaClient.asanaData<AsanaRecord[]>({
+ auth: context.auth,
+ method: HttpMethod.GET,
+ path: `/workspaces/${asanaUtils.pathSegment(workspace)}/typeahead`,
+ operation: 'Search Workspace Objects',
+ query: { resource_type, query, count },
+ });
+ return { data };
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/set-task-parent.ts b/packages/pieces/community/asana/src/lib/actions/ai/set-task-parent.ts
new file mode 100644
index 00000000000..8a2e22e7017
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/set-task-parent.ts
@@ -0,0 +1,67 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+const NO_PARENT = 'none';
+
+export const asanaSetTaskParentAction = createAction({
+ auth: asanaAuth,
+ name: 'set_task_parent',
+ classification: 'WRITE',
+ displayName: 'Set Task Parent',
+ description: 'Make a task a subtask of another task, or detach it from its parent.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Moves an existing task under a new parent task (making it a subtask), or detaches it to top level when Parent is "none". Optionally positions it before or after a sibling subtask. Setting the same parent again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to move. Obtain it from List Project Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ parent: Property.ShortText({
+ displayName: 'Parent Task GID',
+ description: 'Gid of the new parent task, or "none" to remove the current parent.',
+ required: true,
+ }),
+ insert_before: Property.ShortText({
+ displayName: 'Insert Before Subtask',
+ description: 'Gid of an existing subtask of the new parent to place this task before. Cannot be combined with Insert After Subtask.',
+ required: false,
+ }),
+ insert_after: Property.ShortText({
+ displayName: 'Insert After Subtask',
+ description: 'Gid of an existing subtask of the new parent to place this task after. Cannot be combined with Insert Before Subtask.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { task, parent, insert_before, insert_after } = context.propsValue;
+ asanaUtils.assertNotBoth({
+ first: insert_before,
+ second: insert_after,
+ firstLabel: 'Insert Before Subtask',
+ secondLabel: 'Insert After Subtask',
+ });
+ const trimmedParent = parent.trim();
+ const parentValue = trimmedParent.toLowerCase() === NO_PARENT ? null : trimmedParent;
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.POST,
+ path: `/tasks/${asanaUtils.pathSegment(task)}/setParent`,
+ operation: 'Set Task Parent',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data: {
+ parent: parentValue,
+ ...(asanaUtils.hasValue(insert_before) ? { insert_before: String(insert_before).trim() } : {}),
+ ...(asanaUtils.hasValue(insert_after) ? { insert_after: String(insert_after).trim() } : {}),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-comment.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-comment.ts
new file mode 100644
index 00000000000..d6aa1012551
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-comment.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaStoryOutputSchema } from '../../output-schemas';
+
+export const asanaUpdateCommentAction = createAction({
+ auth: asanaAuth,
+ name: 'update_comment',
+ classification: 'WRITE',
+ displayName: 'Update Comment',
+ description: 'Edit or pin a comment on an Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Replaces the text of a comment (plain text or rich text, one of the two) and/or pins or unpins it; unset fields stay unchanged. Only comment stories can be edited, and usually only by their author. Setting the same values again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaStoryOutputSchema,
+ props: {
+ story: Property.ShortText({
+ displayName: 'Comment (Story) GID',
+ description: 'Gid of the comment story. Obtain it from List Task Stories or Add Task Comment.',
+ required: true,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'New plain-text comment; replaces the current text. Cannot be combined with HTML Text.',
+ required: false,
+ }),
+ html_text: Property.LongText({
+ displayName: 'HTML Text',
+ description: 'New rich-text comment wrapped in <body>...</body>; replaces the current text. Cannot be combined with Text.',
+ required: false,
+ }),
+ is_pinned: asanaProps.optionalBoolean({
+ displayName: 'Pinned',
+ description: 'Yes pins the comment, No unpins it. Leave empty to keep the current state.',
+ }),
+ },
+ async run(context) {
+ const { story, text, html_text, is_pinned } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: text, second: html_text, firstLabel: 'Text', secondLabel: 'HTML Text' });
+ const data: Record<string, unknown> = {
+ ...(asanaUtils.hasValue(text) ? { text } : {}),
+ ...(asanaUtils.hasValue(html_text) ? { html_text } : {}),
+ ...(is_pinned !== undefined && is_pinned !== null ? { is_pinned } : {}),
+ };
+ asanaUtils.assertNotEmpty({ patch: data, fields: 'Text, HTML Text or Pinned' });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/stories/${asanaUtils.pathSegment(story)}`,
+ operation: 'Update Comment',
+ query: { opt_fields: ASANA_FIELDS.story },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-project-brief.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-project-brief.ts
new file mode 100644
index 00000000000..704d68cc1b1
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-project-brief.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaProjectBriefOutputSchema } from '../../output-schemas';
+
+export const asanaUpdateProjectBriefAction = createAction({
+ auth: asanaAuth,
+ name: 'update_project_brief',
+ classification: 'WRITE',
+ displayName: 'Update Project Brief',
+ description: 'Change the title or body of an Asana project brief.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates only the brief fields you set: the title, and/or the body in rich text (preferred) or plain text, not both. A new body replaces the whole current body. Setting the same values again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectBriefOutputSchema,
+ props: {
+ project_brief: Property.ShortText({
+ displayName: 'Project Brief GID',
+ description: 'Gid of the project brief. Obtain it from the project_brief field of Get Project.',
+ required: true,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'New title. Leave empty to keep it.',
+ required: false,
+ }),
+ html_text: Property.LongText({
+ displayName: 'HTML Text',
+ description: 'New body in Asana rich text, wrapped in <body>...</body>. Cannot be combined with Text.',
+ required: false,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'New plain-text body. Cannot be combined with HTML Text.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { project_brief, title, html_text, text } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: html_text, second: text, firstLabel: 'HTML Text', secondLabel: 'Text' });
+ const data: Record<string, unknown> = {
+ ...(asanaUtils.hasValue(title) ? { title } : {}),
+ ...(asanaUtils.hasValue(html_text) ? { html_text } : {}),
+ ...(asanaUtils.hasValue(text) ? { text } : {}),
+ };
+ asanaUtils.assertNotEmpty({ patch: data, fields: 'Title, HTML Text or Text' });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/project_briefs/${asanaUtils.pathSegment(project_brief)}`,
+ operation: 'Update Project Brief',
+ query: { opt_fields: ASANA_FIELDS.projectBrief },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-project.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-project.ts
new file mode 100644
index 00000000000..4c6c12829bf
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-project.ts
@@ -0,0 +1,113 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_COLOR_OPTIONS, ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaProjectOutputSchema } from '../../output-schemas';
+
+const DEFAULT_VIEW_OPTIONS = [
+ { label: 'List', value: 'list' },
+ { label: 'Board', value: 'board' },
+ { label: 'Calendar', value: 'calendar' },
+ { label: 'Timeline', value: 'timeline' },
+];
+
+const PRIVACY_OPTIONS = [
+ { label: 'Public to workspace', value: 'public_to_workspace' },
+ { label: 'Private (members only)', value: 'private' },
+];
+
+export const asanaUpdateProjectAction = createAction({
+ auth: asanaAuth,
+ name: 'update_project',
+ classification: 'WRITE',
+ displayName: 'Update Project',
+ description: 'Change fields of an existing Asana project.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates only the project fields you set (name, description, color, default view, privacy, owner, dates, archived); everything else is left unchanged. Archiving hides the project but keeps it, and Archived set to No restores it. Members and followers are changed with Add Project Members and Add Project Followers. Setting the same values again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaProjectOutputSchema,
+ props: {
+ project: Property.ShortText({
+ displayName: 'Project GID',
+ description: 'Gid of the project to update. Obtain it from List Projects or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Project Name',
+ description: 'New project name. Leave empty to keep it.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'New plain-text description; replaces the current one. Leave empty to keep it.',
+ required: false,
+ }),
+ color: Property.StaticDropdown({
+ displayName: 'Color',
+ description: 'New project color. Leave empty to keep it.',
+ required: false,
+ options: { disabled: false, options: ASANA_COLOR_OPTIONS },
+ }),
+ default_view: Property.StaticDropdown({
+ displayName: 'Default View',
+ description: 'New default view. Leave empty to keep it.',
+ required: false,
+ options: { disabled: false, options: DEFAULT_VIEW_OPTIONS },
+ }),
+ privacy_setting: Property.StaticDropdown({
+ displayName: 'Privacy',
+ description: 'New privacy setting. Making a project private hides it from non-members. Leave empty to keep it.',
+ required: false,
+ options: { disabled: false, options: PRIVACY_OPTIONS },
+ }),
+ owner: Property.ShortText({
+ displayName: 'Owner',
+ description: 'New owner: "me", an email address or a user gid. Leave empty to keep it.',
+ required: false,
+ }),
+ start_on: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'New start date in YYYY-MM-DD format. The project must have a due date.',
+ required: false,
+ }),
+ due_on: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'New due date in YYYY-MM-DD format.',
+ required: false,
+ }),
+ archived: asanaProps.optionalBoolean({
+ displayName: 'Archived',
+ description: 'Yes archives the project, No unarchives it. Leave empty to keep the current state.',
+ }),
+ },
+ async run(context) {
+ const { project, name, notes, color, default_view, privacy_setting, owner, start_on, due_on, archived } =
+ context.propsValue;
+ const data: Record<string, unknown> = {
+ ...(asanaUtils.hasValue(name) ? { name } : {}),
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ ...(asanaUtils.hasValue(color) ? { color } : {}),
+ ...(asanaUtils.hasValue(default_view) ? { default_view } : {}),
+ ...(asanaUtils.hasValue(privacy_setting) ? { privacy_setting } : {}),
+ ...(asanaUtils.hasValue(owner) ? { owner: String(owner).trim() } : {}),
+ ...(asanaUtils.hasValue(start_on) ? { start_on: asanaUtils.assertDate({ value: String(start_on), field: 'Start Date' }) } : {}),
+ ...(asanaUtils.hasValue(due_on) ? { due_on: asanaUtils.assertDate({ value: String(due_on), field: 'Due Date' }) } : {}),
+ ...(archived !== undefined && archived !== null ? { archived } : {}),
+ };
+ asanaUtils.assertNotEmpty({
+ patch: data,
+ fields: 'Project Name, Description, Color, Default View, Privacy, Owner, Start Date, Due Date or Archived',
+ });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/projects/${asanaUtils.pathSegment(project)}`,
+ operation: 'Update Project',
+ query: { opt_fields: ASANA_FIELDS.project },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-section.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-section.ts
new file mode 100644
index 00000000000..670fe1222c6
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-section.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaSectionOutputSchema } from '../../output-schemas';
+
+export const asanaUpdateSectionAction = createAction({
+ auth: asanaAuth,
+ name: 'update_section',
+ classification: 'WRITE',
+ displayName: 'Rename Section',
+ description: 'Rename an Asana section.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Renames a section; the name is the only section field Asana lets you change. Use Move Section to reorder it. Setting the same name again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaSectionOutputSchema,
+ props: {
+ section: Property.ShortText({
+ displayName: 'Section GID',
+ description: 'Gid of the section. Obtain it from List Sections.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Section Name',
+ description: 'New name of the section. Cannot be empty.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { section, name } = context.propsValue;
+ if (name.trim() === '') {
+ throw new Error('Section Name cannot be empty.');
+ }
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/sections/${asanaUtils.pathSegment(section)}`,
+ operation: 'Update Section',
+ query: { opt_fields: ASANA_FIELDS.section },
+ data: { name },
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-tag.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-tag.ts
new file mode 100644
index 00000000000..bd022467240
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-tag.ts
@@ -0,0 +1,60 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_COLOR_OPTIONS, ASANA_FIELDS, AsanaRecord, asanaClient, asanaUtils } from '../../common/client';
+import { asanaTagOutputSchema } from '../../output-schemas';
+
+export const asanaUpdateTagAction = createAction({
+ auth: asanaAuth,
+ name: 'update_tag',
+ classification: 'WRITE',
+ displayName: 'Update Tag',
+ description: 'Rename or recolor an Asana tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates only the tag fields you set (name, color, description); the change shows on every task carrying the tag. Setting the same values again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTagOutputSchema,
+ props: {
+ tag: Property.ShortText({
+ displayName: 'Tag GID',
+ description: 'Gid of the tag. Obtain it from List Tags or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Tag Name',
+ description: 'New name. Leave empty to keep it.',
+ required: false,
+ }),
+ color: Property.StaticDropdown({
+ displayName: 'Color',
+ description: 'New color. Leave empty to keep it.',
+ required: false,
+ options: { disabled: false, options: ASANA_COLOR_OPTIONS },
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'New description; replaces the current one. Leave empty to keep it.',
+ required: false,
+ }),
+ },
+ async run(context) {
+ const { tag, name, color, notes } = context.propsValue;
+ const data: Record<string, unknown> = {
+ ...(asanaUtils.hasValue(name) ? { name } : {}),
+ ...(asanaUtils.hasValue(color) ? { color } : {}),
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ };
+ asanaUtils.assertNotEmpty({ patch: data, fields: 'Tag Name, Color or Description' });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/tags/${asanaUtils.pathSegment(tag)}`,
+ operation: 'Update Tag',
+ query: { opt_fields: ASANA_FIELDS.tag },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/ai/update-task.ts b/packages/pieces/community/asana/src/lib/actions/ai/update-task.ts
new file mode 100644
index 00000000000..ebff20fad42
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/actions/ai/update-task.ts
@@ -0,0 +1,93 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { asanaAuth } from '../../auth';
+import { ASANA_FIELDS, AsanaRecord, asanaClient, asanaProps, asanaUtils } from '../../common/client';
+import { asanaTaskOutputSchema } from '../../output-schemas';
+
+export const asanaUpdateTaskAction = createAction({
+ auth: asanaAuth,
+ name: 'update_task',
+ classification: 'WRITE',
+ displayName: 'Update Task',
+ description: 'Change fields of an existing Asana task.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Updates only the task fields you set (name, description, assignee, due date or due time, start date, completed); everything else is left unchanged. Use it to complete or reopen a task too. Projects, tags, followers and parent are changed with their own actions (Add Task to Project, Add Tag to Task, Add Task Followers, Set Task Parent). Setting the same values again converges, so it is safe to retry.',
+ idempotent: true,
+ },
+ outputSchema: asanaTaskOutputSchema,
+ props: {
+ task: Property.ShortText({
+ displayName: 'Task GID',
+ description: 'Gid of the task to update. Obtain it from List Project Tasks, List Assigned Tasks or Search Workspace Objects.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Task Name',
+ description: 'New title of the task. Leave empty to keep the current name.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Description',
+ description: 'New plain-text description; replaces the whole current description. Cannot be combined with HTML Description. Leave empty to keep it.',
+ required: false,
+ }),
+ html_notes: Property.LongText({
+ displayName: 'HTML Description',
+ description: 'New rich-text description wrapped in <body>...</body>; replaces the whole current description. Cannot be combined with Description.',
+ required: false,
+ }),
+ assignee: Property.ShortText({
+ displayName: 'Assignee',
+ description: 'New assignee: "me", an email address or a user gid. Leave empty to keep the current assignee.',
+ required: false,
+ }),
+ due_on: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'New all-day due date in YYYY-MM-DD format. Cannot be combined with Due Date and Time.',
+ required: false,
+ }),
+ due_at: Property.ShortText({
+ displayName: 'Due Date and Time',
+ description: 'New exact due moment as an ISO 8601 date-time that ends in Z (UTC) or a +hh:mm/-hh:mm offset, for example 2026-10-15T17:00:00Z or 2026-10-15T19:00:00+02:00; a value without an offset is rejected. Cannot be combined with Due Date.',
+ required: false,
+ }),
+ start_on: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'New start date in YYYY-MM-DD format. The task must have (or get) a due date.',
+ required: false,
+ }),
+ completed: asanaProps.optionalBoolean({
+ displayName: 'Completed',
+ description: 'Yes marks the task complete, No reopens it. Leave empty to keep the current state.',
+ }),
+ },
+ async run(context) {
+ const { task, name, notes, html_notes, assignee, due_on, due_at, start_on, completed } = context.propsValue;
+ asanaUtils.assertNotBoth({ first: notes, second: html_notes, firstLabel: 'Description', secondLabel: 'HTML Description' });
+ asanaUtils.assertNotBoth({ first: due_on, second: due_at, firstLabel: 'Due Date', secondLabel: 'Due Date and Time' });
+ const data: Record<string, unknown> = {
+ ...(asanaUtils.hasValue(name) ? { name } : {}),
+ ...(asanaUtils.hasValue(notes) ? { notes } : {}),
+ ...(asanaUtils.hasValue(html_notes) ? { html_notes } : {}),
+ ...(asanaUtils.hasValue(assignee) ? { assignee: String(assignee).trim() } : {}),
+ ...(asanaUtils.hasValue(due_on) ? { due_on: asanaUtils.assertDate({ value: String(due_on), field: 'Due Date' }) } : {}),
+ ...(asanaUtils.hasValue(due_at) ? { due_at: asanaUtils.assertDateTime({ value: String(due_at), field: 'Due Date and Time' }) } : {}),
+ ...(asanaUtils.hasValue(start_on) ? { start_on: asanaUtils.assertDate({ value: String(start_on), field: 'Start Date' }) } : {}),
+ ...(completed !== undefined && completed !== null ? { completed } : {}),
+ };
+ asanaUtils.assertNotEmpty({
+ patch: data,
+ fields: 'Task Name, Description, HTML Description, Assignee, Due Date, Due Date and Time, Start Date or Completed',
+ });
+ return asanaClient.asanaData<AsanaRecord>({
+ auth: context.auth,
+ method: HttpMethod.PUT,
+ path: `/tasks/${asanaUtils.pathSegment(task)}`,
+ operation: 'Update Task',
+ query: { opt_fields: ASANA_FIELDS.task },
+ data,
+ });
+ },
+});
diff --git a/packages/pieces/community/asana/src/lib/actions/create-task.ts b/packages/pieces/community/asana/src/lib/actions/create-task.ts
index 077e4454999..52767223ff5 100644
--- a/packages/pieces/community/asana/src/lib/actions/create-task.ts
+++ b/packages/pieces/community/asana/src/lib/actions/create-task.ts
@@ -3,15 +3,17 @@ import { getAccessTokenOrThrow, HttpMethod } from '@activepieces/pieces-common';
import dayjs from 'dayjs';
import { asanaAuth } from '../auth';
import { Property, createAction } from '@activepieces/pieces-framework';
+import { asanaCreateTaskOutputSchema } from '../output-schemas';
export const asanaCreateTaskAction = createAction({
auth: asanaAuth,
name: 'create_task',
classification: 'WRITE',
description: 'Create a new task',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Create a new task in an Asana project, setting its name, description (notes), optional due date, assignee, and tags. Use when an agent needs to add a work item to Asana. Requires a workspace and project; not idempotent — each call creates a separate task even with identical input.', idempotent: false },
displayName: 'Create Task',
+ outputSchema: asanaCreateTaskOutputSchema,
props: {
workspace: asanaCommon.workspace,
project: asanaCommon.project,
diff --git a/packages/pieces/community/asana/src/lib/common/client.ts b/packages/pieces/community/asana/src/lib/common/client.ts
new file mode 100644
index 00000000000..f51b388fe2c
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/common/client.ts
@@ -0,0 +1,520 @@
+import {
+ AuthenticationType,
+ httpClient,
+ HttpError,
+ HttpMethod,
+} from '@activepieces/pieces-common';
+import { Property } from '@activepieces/pieces-framework';
+
+const BASE_URL = 'https://app.asana.com/api/1.0';
+const DEFAULT_LIMIT = 50;
+const MAX_LIMIT = 100;
+const MAX_TAG_PAGES = 20;
+const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
+const DATE_TIME_PATTERN = /^\d{4}-\d{2}-\d{2}T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-](\d{2}):(\d{2}))$/i;
+const MAX_ERROR_BODY_LENGTH = 300;
+const GID_PATTERN = /^\d+$/;
+
+const RATE_LIMIT_GUIDANCE =
+ 'Asana allows about 150 requests per minute on free workspaces and 1,500 on paid ones, plus concurrency and cost limits. Wait about a minute (Asana sends the exact delay in its Retry-After header) before retrying; rejected requests still count against the quota.';
+
+function extractVendorMessage(body: unknown): string | undefined {
+ if (typeof body === 'string' && body.trim() !== '') {
+ const trimmed = body.trim();
+ return trimmed.length > MAX_ERROR_BODY_LENGTH ? `${trimmed.slice(0, MAX_ERROR_BODY_LENGTH)}...` : trimmed;
+ }
+ if (typeof body !== 'object' || body === null || !('errors' in body)) {
+ return undefined;
+ }
+ const errors = body.errors;
+ if (!Array.isArray(errors)) {
+ return undefined;
+ }
+ const messages: string[] = [];
+ for (const entry of errors) {
+ if (typeof entry === 'object' && entry !== null && 'message' in entry && typeof entry.message === 'string') {
+ messages.push(entry.message);
+ }
+ }
+ return messages.length === 0 ? undefined : messages.join('; ');
+}
+
+function describeFailure({
+ status,
+ body,
+ operation,
+}: {
+ status: number;
+ body: unknown;
+ operation: string;
+}): string {
+ const vendorMessage = extractVendorMessage(body);
+ const vendorSuffix = vendorMessage === undefined ? '' : ` Asana said: "${vendorMessage}".`;
+ switch (status) {
+ case 400:
+ return `Asana rejected ${operation} as invalid.${vendorSuffix}`;
+ case 401:
+ return `Asana rejected the connection while running ${operation}: the access token is invalid or has expired. Reconnect the Asana account in Activepieces.${vendorSuffix}`;
+ case 402:
+ return `This Asana feature needs a paid plan: ${operation} is above the current premium level of the workspace (Starter, Advanced or Enterprise is required).${vendorSuffix}`;
+ case 403:
+ return `Asana refused ${operation}: the connected user does not have permission for this resource or action.${vendorSuffix}`;
+ case 404:
+ return `Asana could not find the resource for ${operation}. Check the gid; the object may not exist, may have been deleted, or may not be visible to the connected user.${vendorSuffix}`;
+ case 429:
+ return `Asana rate limit reached while running ${operation}. ${RATE_LIMIT_GUIDANCE}`;
+ default:
+ return `Asana returned HTTP ${status} for ${operation}.${vendorSuffix}`;
+ }
+}
+
+function toQueryParams(query: AsanaQuery | undefined): Record<string, string> {
+ const params: Record<string, string> = {};
+ if (query === undefined) {
+ return params;
+ }
+ for (const [key, value] of Object.entries(query)) {
+ if (value === undefined || value === null || value === '') {
+ continue;
+ }
+ params[key] = String(value);
+ }
+ return params;
+}
+
+async function asanaApi<T>({
+ auth,
+ method,
+ path,
+ query,
+ data,
+ operation,
+}: AsanaRequestParams): Promise<T> {
+ try {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${BASE_URL}${path}`,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.access_token,
+ },
+ queryParams: toQueryParams(query),
+ body: data === undefined ? undefined : { data },
+ });
+ return response.body;
+ } catch (error) {
+ if (error instanceof HttpError) {
+ const status = error.response.status;
+ throw new AsanaApiError({
+ status,
+ message: describeFailure({ status, body: error.response.body, operation }),
+ });
+ }
+ throw error;
+ }
+}
+
+async function asanaData<T>(params: AsanaRequestParams): Promise<T> {
+ const body = await asanaApi<AsanaEnvelope<T>>(params);
+ return body.data;
+}
+
+async function asanaEmpty(params: AsanaRequestParams): Promise<void> {
+ await asanaApi<unknown>(params);
+}
+
+function assertLimit(limit: number | undefined | null): number {
+ if (limit === undefined || limit === null) {
+ return DEFAULT_LIMIT;
+ }
+ if (!Number.isInteger(limit) || limit < 1 || limit > MAX_LIMIT) {
+ throw new Error(`Limit must be a whole number between 1 and ${MAX_LIMIT}, got ${limit}.`);
+ }
+ return limit;
+}
+
+async function asanaListPage<T>({
+ auth,
+ path,
+ query,
+ limit,
+ offset,
+ operation,
+}: AsanaListParams): Promise<AsanaPage<T>> {
+ const body = await asanaApi<AsanaListEnvelope<T>>({
+ auth,
+ method: HttpMethod.GET,
+ path,
+ operation,
+ query: {
+ ...query,
+ limit: assertLimit(limit),
+ offset: hasValue(offset) ? offset : undefined,
+ },
+ });
+ const data = Array.isArray(body.data) ? body.data : [];
+ const nextOffset = body.next_page?.offset;
+ return {
+ data,
+ next_offset: typeof nextOffset === 'string' && nextOffset !== '' ? nextOffset : null,
+ };
+}
+
+async function fetchWorkspaceTags({
+ auth,
+ workspace,
+}: {
+ auth: AsanaAuth;
+ workspace: string;
+}): Promise<{ tags: AsanaNamedRecord[]; truncated: boolean }> {
+ const tags: AsanaNamedRecord[] = [];
+ let offset: string | null = null;
+ for (let page = 0; page < MAX_TAG_PAGES; page++) {
+ const result: AsanaPage<AsanaNamedRecord> = await asanaListPage<AsanaNamedRecord>({
+ auth,
+ path: '/tags',
+ query: { workspace, opt_fields: 'name' },
+ limit: MAX_LIMIT,
+ offset: offset ?? undefined,
+ operation: 'Create Project Task (tag lookup)',
+ });
+ tags.push(...result.data);
+ offset = result.next_offset;
+ if (offset === null) {
+ break;
+ }
+ }
+ return { tags, truncated: offset !== null };
+}
+
+async function isExistingTagGid({ auth, gid }: { auth: AsanaAuth; gid: string }): Promise<boolean> {
+ try {
+ await asanaApi<unknown>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/tags/${encodeURIComponent(gid)}`,
+ query: { opt_fields: 'name' },
+ operation: 'Create Project Task (tag gid check)',
+ });
+ return true;
+ } catch (error) {
+ if (error instanceof AsanaApiError && (error.status === 404 || error.status === 400)) {
+ return false;
+ }
+ throw error;
+ }
+}
+
+async function resolveTagGids({
+ auth,
+ workspace,
+ tags,
+}: {
+ auth: AsanaAuth;
+ workspace: string;
+ tags: string[];
+}): Promise<string[]> {
+ const pending: string[] = [];
+ const confirmedGids = new Set<string>();
+ for (const tag of tags) {
+ if (GID_PATTERN.test(tag) && (await isExistingTagGid({ auth, gid: tag }))) {
+ confirmedGids.add(tag);
+ continue;
+ }
+ pending.push(tag);
+ }
+ const byName = new Map<string, string>();
+ let truncated = false;
+ if (pending.length > 0) {
+ const lookup = await fetchWorkspaceTags({ auth, workspace });
+ truncated = lookup.truncated;
+ for (const candidate of lookup.tags) {
+ if (typeof candidate.name === 'string' && !byName.has(candidate.name.toLowerCase())) {
+ byName.set(candidate.name.toLowerCase(), candidate.gid);
+ }
+ }
+ }
+ const missing: string[] = [];
+ const gids: string[] = [];
+ for (const tag of tags) {
+ if (confirmedGids.has(tag)) {
+ gids.push(tag);
+ continue;
+ }
+ const match = byName.get(tag.toLowerCase());
+ if (match === undefined) {
+ missing.push(tag);
+ continue;
+ }
+ gids.push(match);
+ }
+ if (missing.length > 0) {
+ const names = missing.map((name) => `"${name}"`).join(', ');
+ if (truncated) {
+ throw new Error(
+ `Tag ${names} was not found in the first ${(MAX_TAG_PAGES * MAX_LIMIT).toLocaleString('en-US')} tags of workspace ${workspace}; pass the tag gid instead (find it with List Tags or Search Workspace Objects).`
+ );
+ }
+ throw new Error(
+ `No tag named ${names} exists in workspace ${workspace}. Create it first with Create Tag, or pass existing tag gids from List Tags.`
+ );
+ }
+ return gids;
+}
+
+function hasValue(value: unknown): boolean {
+ return value !== undefined && value !== null && value !== '';
+}
+
+function toStringArray(value: unknown): string[] {
+ if (typeof value === 'string') {
+ return toStringArray(parseListString(value));
+ }
+ if (!Array.isArray(value)) {
+ return [];
+ }
+ return value
+ .filter((item) => typeof item === 'string' || typeof item === 'number')
+ .map((item) => String(item).trim())
+ .filter((item) => item !== '');
+}
+
+function parseListString(value: string): unknown[] {
+ const trimmed = value.trim();
+ if (trimmed.startsWith('[')) {
+ const parsed = parseJson(trimmed);
+ if (Array.isArray(parsed)) {
+ return parsed;
+ }
+ }
+ return trimmed.split(',');
+}
+
+function parseJson(value: string): unknown {
+ try {
+ return JSON.parse(value);
+ } catch {
+ return undefined;
+ }
+}
+
+function isCalendarDate(value: string): boolean {
+ const parsed = new Date(`${value}T00:00:00Z`);
+ return DATE_PATTERN.test(value) && !Number.isNaN(parsed.getTime()) && parsed.toISOString().slice(0, 10) === value;
+}
+
+function isInRange({ value, max }: { value: string | undefined; max: number }): boolean {
+ return value === undefined || Number(value) <= max;
+}
+
+function assertDate({ value, field }: { value: string; field: string }): string {
+ const trimmed = value.trim();
+ if (!isCalendarDate(trimmed)) {
+ throw new Error(`${field} must be a calendar date in YYYY-MM-DD format, got "${value}".`);
+ }
+ return trimmed;
+}
+
+function assertDateTime({ value, field }: { value: string; field: string }): string {
+ const trimmed = value.trim();
+ const parsed = new Date(trimmed);
+ const match = DATE_TIME_PATTERN.exec(trimmed);
+ const validParts =
+ match !== null &&
+ isCalendarDate(trimmed.slice(0, 10)) &&
+ isInRange({ value: match[1], max: 23 }) &&
+ isInRange({ value: match[2], max: 59 }) &&
+ isInRange({ value: match[3], max: 59 }) &&
+ isInRange({ value: match[4], max: 23 }) &&
+ isInRange({ value: match[5], max: 59 });
+ if (!validParts || Number.isNaN(parsed.getTime())) {
+ throw new Error(
+ `${field} must be an ISO 8601 date-time with a time part that ends in Z or a +hh:mm/-hh:mm offset, such as 2026-10-01T15:00:00Z or 2026-10-01T17:00:00+02:00, got "${value}". Use the date-only field for an all-day date.`
+ );
+ }
+ return parsed.toISOString();
+}
+
+function assertNotBoth({
+ first,
+ second,
+ firstLabel,
+ secondLabel,
+}: {
+ first: unknown;
+ second: unknown;
+ firstLabel: string;
+ secondLabel: string;
+}): void {
+ if (hasValue(first) && hasValue(second)) {
+ throw new Error(`Set either ${firstLabel} or ${secondLabel}, not both; Asana accepts only one of them.`);
+ }
+}
+
+function assertNotEmpty({ patch, fields }: { patch: Record<string, unknown>; fields: string }): void {
+ if (Object.keys(patch).length === 0) {
+ throw new Error(`Nothing to update: set at least one of ${fields}.`);
+ }
+}
+
+function pathSegment(value: string): string {
+ return encodeURIComponent(value.trim());
+}
+
+function optionalBooleanProp({
+ displayName,
+ description,
+}: {
+ displayName: string;
+ description: string;
+}) {
+ return Property.StaticDropdown<boolean>({
+ displayName,
+ description,
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: true },
+ { label: 'No', value: false },
+ ],
+ },
+ });
+}
+
+function limitProp({ noun }: { noun: string }) {
+ return Property.Number({
+ displayName: 'Limit',
+ description: `Maximum number of ${noun} to return in this page, from 1 to ${MAX_LIMIT}. Defaults to ${DEFAULT_LIMIT}.`,
+ required: false,
+ });
+}
+
+function offsetProp() {
+ return Property.ShortText({
+ displayName: 'Offset',
+ description:
+ 'Pagination token for the next page. Pass the `next_offset` value returned by the previous call of this same action; leave empty for the first page. Tokens expire after a while.',
+ required: false,
+ });
+}
+
+export class AsanaApiError extends Error {
+ public readonly status: number;
+
+ constructor({ status, message }: { status: number; message: string }) {
+ super(message);
+ this.name = 'AsanaApiError';
+ this.status = status;
+ }
+}
+
+export const asanaClient = {
+ asanaApi,
+ asanaData,
+ asanaEmpty,
+ asanaListPage,
+ resolveTagGids,
+};
+
+export const asanaProps = {
+ optionalBoolean: optionalBooleanProp,
+ limit: limitProp,
+ offset: offsetProp,
+};
+
+export const asanaUtils = {
+ hasValue,
+ toStringArray,
+ assertDate,
+ assertDateTime,
+ assertNotBoth,
+ assertNotEmpty,
+ pathSegment,
+};
+
+export const ASANA_COLOR_OPTIONS = [
+ 'dark-pink',
+ 'dark-green',
+ 'dark-blue',
+ 'dark-red',
+ 'dark-teal',
+ 'dark-brown',
+ 'dark-orange',
+ 'dark-purple',
+ 'dark-warm-gray',
+ 'light-pink',
+ 'light-green',
+ 'light-blue',
+ 'light-red',
+ 'light-teal',
+ 'light-brown',
+ 'light-orange',
+ 'light-purple',
+ 'light-warm-gray',
+].map((color) => ({ label: color, value: color }));
+
+export const ASANA_FIELDS = {
+ task: 'name,resource_subtype,notes,completed,completed_at,created_at,modified_at,due_on,due_at,start_on,start_at,assignee.name,assignee.email,parent.name,projects.name,memberships.project.name,memberships.section.name,tags.name,followers.name,workspace.name,num_subtasks,permalink_url',
+ taskList: 'name,resource_subtype,completed,completed_at,created_at,modified_at,due_on,due_at,start_on,assignee.name,parent.name,permalink_url',
+ project: 'name,archived,color,completed,completed_at,created_at,modified_at,default_view,due_on,start_on,notes,owner.name,privacy_setting,team.name,workspace.name,current_status_update.title,current_status_update.status_type,project_brief,members.name,followers.name,permalink_url',
+ projectList: 'name,archived,color,created_at,modified_at,due_on,start_on,owner.name,privacy_setting,team.name,permalink_url',
+ story: 'created_at,created_by.name,resource_subtype,type,text,html_text,is_pinned,is_edited,is_editable,sticker_name,target.name',
+ storyList: 'created_at,created_by.name,resource_subtype,type,text,is_pinned,is_edited',
+ section: 'name,created_at,project.name',
+ tag: 'name,color,notes,created_at,followers.name,workspace.name,permalink_url',
+ tagList: 'name,color,created_at,permalink_url',
+ job: 'resource_subtype,status,new_task.name,new_project.name,new_project_template.name',
+ statusUpdate: 'title,text,status_type,resource_subtype,created_at,modified_at,author.name,created_by.name,parent.name',
+ projectBrief: 'title,text,html_text,permalink_url,project.name',
+ user: 'name,email,workspaces.name',
+ workspace: 'name,is_organization,email_domains',
+ team: 'name,description,visibility,organization.name,permalink_url',
+ taskCounts: 'num_tasks,num_completed_tasks,num_incomplete_tasks,num_milestones,num_completed_milestones,num_incomplete_milestones',
+};
+
+export type AsanaAuth = {
+ access_token: string;
+};
+
+export type AsanaQuery = Record<string, string | number | boolean | undefined | null>;
+
+export type AsanaRequestParams = {
+ auth: AsanaAuth;
+ method: HttpMethod;
+ path: string;
+ operation: string;
+ query?: AsanaQuery;
+ data?: Record<string, unknown>;
+};
+
+export type AsanaListParams = {
+ auth: AsanaAuth;
+ path: string;
+ operation: string;
+ query?: AsanaQuery;
+ limit?: number | null;
+ offset?: string | null;
+};
+
+export type AsanaEnvelope<T> = {
+ data: T;
+};
+
+export type AsanaListEnvelope<T> = {
+ data: T[];
+ next_page?: { offset?: string; path?: string; uri?: string } | null;
+};
+
+export type AsanaPage<T> = {
+ data: T[];
+ next_offset: string | null;
+};
+
+export type AsanaNamedRecord = {
+ gid: string;
+ name?: string;
+ resource_type?: string;
+};
+
+export type AsanaRecord = Record<string, unknown>;
diff --git a/packages/pieces/community/asana/src/lib/output-schemas.ts b/packages/pieces/community/asana/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..d4da252dff2
--- /dev/null
+++ b/packages/pieces/community/asana/src/lib/output-schemas.ts
@@ -0,0 +1,474 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const namedRefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'GID' },
+ { key: 'name', label: 'Name' },
+];
+
+const userRefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'User GID' },
+ { key: 'name', label: 'Name' },
+];
+
+const userFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'User GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+];
+
+const workspaceRefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Workspace GID' },
+ { key: 'name', label: 'Workspace Name' },
+];
+
+const projectRefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Project GID' },
+ { key: 'name', label: 'Project Name' },
+];
+
+const taskRefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Task GID' },
+ { key: 'name', label: 'Task Name' },
+];
+
+const taskListItemFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Task GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'resource_subtype', label: 'Task Type' },
+ { key: 'completed', label: 'Completed', format: 'boolean' },
+ { key: 'completed_at', label: 'Completed At', format: 'datetime' },
+ { key: 'due_on', label: 'Due On', format: 'date' },
+ { key: 'due_at', label: 'Due At', format: 'datetime' },
+ { key: 'start_on', label: 'Start On', format: 'date' },
+ { key: 'assignee', label: 'Assignee', children: userRefFields },
+ { key: 'parent', label: 'Parent Task', children: taskRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'modified_at', label: 'Modified At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Task URL', format: 'url' },
+];
+
+const taskFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Task GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'resource_subtype', label: 'Task Type' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'completed', label: 'Completed', format: 'boolean' },
+ { key: 'completed_at', label: 'Completed At', format: 'datetime' },
+ { key: 'due_on', label: 'Due On', format: 'date' },
+ { key: 'due_at', label: 'Due At', format: 'datetime' },
+ { key: 'start_on', label: 'Start On', format: 'date' },
+ { key: 'start_at', label: 'Start At', format: 'datetime' },
+ { key: 'assignee', label: 'Assignee', children: userFields },
+ { key: 'parent', label: 'Parent Task', children: taskRefFields },
+ { key: 'projects', label: 'Projects', labelKey: 'name', listItems: projectRefFields },
+ {
+ key: 'memberships',
+ label: 'Project Placements',
+ listItems: [
+ { key: 'project', label: 'Project', children: projectRefFields },
+ {
+ key: 'section',
+ label: 'Section',
+ children: [
+ { key: 'gid', label: 'Section GID' },
+ { key: 'name', label: 'Section Name' },
+ ],
+ },
+ ],
+ },
+ { key: 'tags', label: 'Tags', labelKey: 'name', listItems: namedRefFields },
+ { key: 'followers', label: 'Followers', labelKey: 'name', listItems: userRefFields },
+ { key: 'workspace', label: 'Workspace', children: workspaceRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'modified_at', label: 'Modified At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Task URL', format: 'url' },
+];
+
+const projectListItemFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Project GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'archived', label: 'Archived', format: 'boolean' },
+ { key: 'color', label: 'Color' },
+ { key: 'privacy_setting', label: 'Privacy' },
+ { key: 'start_on', label: 'Start On', format: 'date' },
+ { key: 'due_on', label: 'Due On', format: 'date' },
+ { key: 'owner', label: 'Owner', children: userRefFields },
+ { key: 'team', label: 'Team', children: namedRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'modified_at', label: 'Modified At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Project URL', format: 'url' },
+];
+
+const projectFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Project GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'archived', label: 'Archived', format: 'boolean' },
+ { key: 'completed', label: 'Completed', format: 'boolean' },
+ { key: 'completed_at', label: 'Completed At', format: 'datetime' },
+ { key: 'color', label: 'Color' },
+ { key: 'default_view', label: 'Default View' },
+ { key: 'privacy_setting', label: 'Privacy' },
+ { key: 'start_on', label: 'Start On', format: 'date' },
+ { key: 'due_on', label: 'Due On', format: 'date' },
+ { key: 'owner', label: 'Owner', children: userRefFields },
+ { key: 'team', label: 'Team', children: namedRefFields },
+ { key: 'workspace', label: 'Workspace', children: workspaceRefFields },
+ { key: 'members', label: 'Members', labelKey: 'name', listItems: userRefFields },
+ { key: 'followers', label: 'Followers', labelKey: 'name', listItems: userRefFields },
+ {
+ key: 'current_status_update',
+ label: 'Latest Status Update',
+ children: [
+ { key: 'gid', label: 'Status Update GID' },
+ { key: 'title', label: 'Title' },
+ { key: 'status_type', label: 'Status' },
+ ],
+ },
+ { key: 'project_brief', label: 'Project Brief', children: [{ key: 'gid', label: 'Project Brief GID' }] },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'modified_at', label: 'Modified At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Project URL', format: 'url' },
+];
+
+const sectionFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Section GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'project', label: 'Project', children: projectRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+];
+
+const storyListItemFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Story GID' },
+ { key: 'type', label: 'Story Type' },
+ { key: 'resource_subtype', label: 'Event' },
+ { key: 'text', label: 'Text' },
+ { key: 'is_pinned', label: 'Pinned', format: 'boolean' },
+ { key: 'is_edited', label: 'Edited', format: 'boolean' },
+ { key: 'created_by', label: 'Created By', children: userRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+];
+
+const storyFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Story GID' },
+ { key: 'type', label: 'Story Type' },
+ { key: 'resource_subtype', label: 'Event' },
+ { key: 'text', label: 'Text' },
+ { key: 'html_text', label: 'Rich Text', format: 'html' },
+ { key: 'is_pinned', label: 'Pinned', format: 'boolean' },
+ { key: 'is_edited', label: 'Edited', format: 'boolean' },
+ { key: 'is_editable', label: 'Editable', format: 'boolean' },
+ { key: 'sticker_name', label: 'Sticker' },
+ { key: 'target', label: 'Task', children: taskRefFields },
+ { key: 'created_by', label: 'Created By', children: userRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+];
+
+const tagListItemFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Tag GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'color', label: 'Color' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Tag URL', format: 'url' },
+];
+
+const tagFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Tag GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'color', label: 'Color' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'followers', label: 'Followers', labelKey: 'name', listItems: userRefFields },
+ { key: 'workspace', label: 'Workspace', children: workspaceRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'permalink_url', label: 'Tag URL', format: 'url' },
+];
+
+const statusUpdateFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Status Update GID' },
+ { key: 'title', label: 'Title' },
+ { key: 'status_type', label: 'Status' },
+ { key: 'text', label: 'Text' },
+ { key: 'resource_subtype', label: 'Update Type' },
+ { key: 'parent', label: 'Parent', children: namedRefFields },
+ { key: 'author', label: 'Author', children: userRefFields },
+ { key: 'created_by', label: 'Created By', children: userRefFields },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'modified_at', label: 'Modified At', format: 'datetime' },
+];
+
+const projectBriefFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Project Brief GID' },
+ { key: 'title', label: 'Title' },
+ { key: 'text', label: 'Text' },
+ { key: 'html_text', label: 'Rich Text', format: 'html' },
+ { key: 'project', label: 'Project', children: projectRefFields },
+ { key: 'permalink_url', label: 'Brief URL', format: 'url' },
+];
+
+const jobFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Job GID' },
+ { key: 'resource_subtype', label: 'Job Type' },
+ { key: 'status', label: 'Status' },
+ { key: 'new_task', label: 'New Task', children: taskRefFields },
+ { key: 'new_project', label: 'New Project', children: projectRefFields },
+ {
+ key: 'new_project_template',
+ label: 'New Project Template',
+ children: [
+ { key: 'gid', label: 'Project Template GID' },
+ { key: 'name', label: 'Project Template Name' },
+ ],
+ },
+];
+
+const membershipFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Membership GID' },
+ { key: 'resource_subtype', label: 'Membership Type' },
+ { key: 'access_level', label: 'Access Level' },
+ {
+ key: 'parent',
+ label: 'Parent',
+ children: [
+ { key: 'gid', label: 'Parent GID' },
+ { key: 'resource_type', label: 'Parent Type' },
+ { key: 'name', label: 'Parent Name' },
+ ],
+ },
+ {
+ key: 'member',
+ label: 'Member',
+ children: [
+ { key: 'gid', label: 'Member GID' },
+ { key: 'resource_type', label: 'Member Type' },
+ { key: 'name', label: 'Member Name' },
+ ],
+ },
+];
+
+const currentUserFields: OutputSchema['fields'] = [
+ ...userFields,
+ { key: 'workspaces', label: 'Workspaces', labelKey: 'name', listItems: workspaceRefFields },
+];
+
+const workspaceFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Workspace GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'is_organization', label: 'Is Organization', format: 'boolean' },
+ { key: 'email_domains', label: 'Email Domains' },
+];
+
+const teamListItemFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'Team GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'visibility', label: 'Visibility' },
+ { key: 'organization', label: 'Organization', children: workspaceRefFields },
+ { key: 'permalink_url', label: 'Team URL', format: 'url' },
+];
+
+const searchResultFields: OutputSchema['fields'] = [
+ { key: 'gid', label: 'GID' },
+ { key: 'name', label: 'Name' },
+ { key: 'resource_type', label: 'Object Type' },
+ { key: 'resource_subtype', label: 'Subtype' },
+];
+
+function listPage({
+ key,
+ label,
+ labelKey,
+ itemFields,
+}: {
+ key: string;
+ label: string;
+ labelKey: string;
+ itemFields: OutputSchema['fields'];
+}): OutputSchema {
+ return {
+ fields: [
+ { key: 'data', label, labelKey, listItems: itemFields },
+ {
+ key: 'next_offset',
+ label: 'Next Page Offset',
+ description: `Pass as offset to fetch the next page of ${key}; empty when there are no more.`,
+ },
+ ],
+ };
+}
+
+function confirmation({
+ fields,
+}: {
+ fields: { key: string; label: string }[];
+}): OutputSchema {
+ return {
+ fields: [{ key: 'success', label: 'Success', format: 'boolean' }, ...fields],
+ };
+}
+
+export const asanaTaskOutputSchema: OutputSchema = { fields: taskFields };
+
+export const asanaGetTaskOutputSchema: OutputSchema = {
+ fields: [...taskFields, { key: 'num_subtasks', label: 'Subtask Count', format: 'number' }],
+};
+
+export const asanaCreateTaskOutputSchema: OutputSchema = {
+ fields: [
+ ...taskFields,
+ { key: 'assignee_status', label: 'Assignee Status' },
+ { key: 'num_likes', label: 'Likes', format: 'number' },
+ ],
+};
+
+export const asanaTaskListOutputSchema = listPage({
+ key: 'tasks',
+ label: 'Tasks',
+ labelKey: 'name',
+ itemFields: taskListItemFields,
+});
+
+export const asanaProjectOutputSchema: OutputSchema = { fields: projectFields };
+
+export const asanaProjectListOutputSchema = listPage({
+ key: 'projects',
+ label: 'Projects',
+ labelKey: 'name',
+ itemFields: projectListItemFields,
+});
+
+export const asanaProjectTaskCountsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'project_gid', label: 'Project GID' },
+ { key: 'num_tasks', label: 'Tasks', format: 'number' },
+ { key: 'num_completed_tasks', label: 'Completed Tasks', format: 'number' },
+ { key: 'num_incomplete_tasks', label: 'Incomplete Tasks', format: 'number' },
+ { key: 'num_milestones', label: 'Milestones', format: 'number' },
+ { key: 'num_completed_milestones', label: 'Completed Milestones', format: 'number' },
+ { key: 'num_incomplete_milestones', label: 'Incomplete Milestones', format: 'number' },
+ ],
+};
+
+export const asanaSectionOutputSchema: OutputSchema = { fields: sectionFields };
+
+export const asanaSectionListOutputSchema = listPage({
+ key: 'sections',
+ label: 'Sections',
+ labelKey: 'name',
+ itemFields: sectionFields,
+});
+
+export const asanaStoryOutputSchema: OutputSchema = { fields: storyFields };
+
+export const asanaStoryListOutputSchema = listPage({
+ key: 'stories',
+ label: 'Stories',
+ labelKey: 'text',
+ itemFields: storyListItemFields,
+});
+
+export const asanaTagOutputSchema: OutputSchema = { fields: tagFields };
+
+export const asanaTagListOutputSchema = listPage({
+ key: 'tags',
+ label: 'Tags',
+ labelKey: 'name',
+ itemFields: tagListItemFields,
+});
+
+export const asanaStatusUpdateOutputSchema: OutputSchema = { fields: statusUpdateFields };
+
+export const asanaStatusUpdateListOutputSchema = listPage({
+ key: 'status updates',
+ label: 'Status Updates',
+ labelKey: 'title',
+ itemFields: statusUpdateFields,
+});
+
+export const asanaProjectBriefOutputSchema: OutputSchema = { fields: projectBriefFields };
+
+export const asanaJobOutputSchema: OutputSchema = { fields: jobFields };
+
+export const asanaMembershipOutputSchema: OutputSchema = { fields: membershipFields };
+
+export const asanaMembershipListOutputSchema = listPage({
+ key: 'memberships',
+ label: 'Memberships',
+ labelKey: 'access_level',
+ itemFields: membershipFields,
+});
+
+export const asanaCurrentUserOutputSchema: OutputSchema = { fields: currentUserFields };
+
+export const asanaWorkspaceListOutputSchema = listPage({
+ key: 'workspaces',
+ label: 'Workspaces',
+ labelKey: 'name',
+ itemFields: workspaceFields,
+});
+
+export const asanaTeamListOutputSchema = listPage({
+ key: 'teams',
+ label: 'Teams',
+ labelKey: 'name',
+ itemFields: teamListItemFields,
+});
+
+export const asanaSearchWorkspaceObjectsOutputSchema: OutputSchema = {
+ fields: [{ key: 'data', label: 'Results', labelKey: 'name', listItems: searchResultFields }],
+};
+
+export const asanaTaskTagChangeOutputSchema = confirmation({
+ fields: [
+ { key: 'task_gid', label: 'Task GID' },
+ { key: 'tag_gid', label: 'Tag GID' },
+ ],
+});
+
+export const asanaTaskProjectChangeOutputSchema = confirmation({
+ fields: [
+ { key: 'task_gid', label: 'Task GID' },
+ { key: 'project_gid', label: 'Project GID' },
+ ],
+});
+
+export const asanaMoveTaskToSectionOutputSchema = confirmation({
+ fields: [
+ { key: 'task_gid', label: 'Task GID' },
+ { key: 'section_gid', label: 'Section GID' },
+ ],
+});
+
+export const asanaMoveSectionOutputSchema = confirmation({
+ fields: [
+ { key: 'section_gid', label: 'Section GID' },
+ { key: 'project_gid', label: 'Project GID' },
+ ],
+});
+
+export const asanaDeleteTaskOutputSchema = confirmation({ fields: [{ key: 'task_gid', label: 'Deleted Task GID' }] });
+
+export const asanaDeleteProjectOutputSchema = confirmation({
+ fields: [{ key: 'project_gid', label: 'Deleted Project GID' }],
+});
+
+export const asanaDeleteSectionOutputSchema = confirmation({
+ fields: [{ key: 'section_gid', label: 'Deleted Section GID' }],
+});
+
+export const asanaDeleteTagOutputSchema = confirmation({ fields: [{ key: 'tag_gid', label: 'Deleted Tag GID' }] });
+
+export const asanaDeleteCommentOutputSchema = confirmation({
+ fields: [{ key: 'story_gid', label: 'Deleted Comment GID' }],
+});
+
+export const asanaDeleteStatusUpdateOutputSchema = confirmation({
+ fields: [{ key: 'status_update_gid', label: 'Deleted Status Update GID' }],
+});
+
+export const asanaDeleteProjectBriefOutputSchema = confirmation({
+ fields: [{ key: 'project_brief_gid', label: 'Deleted Project Brief GID' }],
+});
+
+export const asanaDeleteMembershipOutputSchema = confirmation({
+ fields: [{ key: 'membership_gid', label: 'Deleted Membership GID' }],
+});