Delete Task

Definition

The Delete Task action permanently removes a specified task from a project within Asana. It is a straightforward but powerful action used to automate the cleanup and management of your project boards, ensuring that completed, canceled, or irrelevant tasks are removed from view.

  • Key capabilities:
    • Select a specific project to operate within.
    • Identify and delete a task using its unique Task ID.

This action is valuable for maintaining clean project boards and automating archival or completion workflows by programmatically removing tasks that are no longer needed.


Inputs

  1. Connection

    • Purpose: This field is for authenticating your Asana account, granting zenphi the necessary permissions to access your projects and delete tasks on your behalf.
    • Practical Guidance: You will typically select a pre-configured Asana connection from a dropdown menu. This is a static value that links the action to a specific user's Asana account.
    • Use Case Context: You would use the 'Connection' field to authorize zenphi to interact with your Asana workspace.
  2. Project

    • Purpose: This field specifies the Asana project that contains the task you intend to delete.
    • Practical Guidance: After establishing a connection, a dropdown list of available projects will appear for you to choose from. You can select a project directly (a static value). For more advanced flows, you could dynamically provide a Project ID from a previous step (e.g., 'Find Project') using the token picker.
    • Use Case Context: You would use the 'Project' field to tell zenphi exactly which project, such as "Website Redesign," holds the task you want to remove.
  3. Task Id

    • Purpose: This field requires the unique identifier of the specific task you want to delete.
    • Practical Guidance: Once a project is selected, a dropdown list of tasks within that project will become available. While you can select a task directly (a static value), it is more common in automation to use the token picker to insert a dynamic value, such as the 'Task ID' output from a 'Create Task' or 'Find Task' action earlier in the flow.
    • Use Case Context: You would use the 'Task Id' to ensure zenphi deletes the precise task you targeted, preventing accidental data loss.

Outputs

This action does not return any output values. A successful execution of this step indicates that the specified task has been deleted in Asana.


Example Use Cases

  1. Automate Project Cleanup Automatically delete tasks once they are moved to a "Completed" or "Archived" section to keep project boards clean and focused.
  2. Remove Canceled Requests When a request submitted via a form or another system is canceled, trigger a flow to automatically delete the corresponding Asana task.
  3. Correct Data Entry Errors If a workflow accidentally creates a duplicate or incorrect task, use this action to programmatically remove the erroneous entry.
  4. Streamline Offboarding As part of a user offboarding process, automatically delete any remaining tasks assigned to the departing employee to ensure a clean handover.

Example

Scenario: A marketing team uses a Google Form for new content requests, which automatically creates a task in their "Content Pipeline" project in Asana. However, if a request is later deemed invalid and marked as "Canceled" in the source Google Sheet, the corresponding Asana task needs to be deleted to prevent the team from working on it.

Steps to Implement:

  1. Set up a trigger for the workflow, such as the Google Sheets - On Row Updated trigger. Configure it to start the flow when the "Status" column in your request sheet is updated to "Canceled".
  2. Ensure the Google Sheet contains the Asana Task ID that was generated when the task was initially created. This ID is crucial for identifying which task to delete.
  3. Add the Asana - Delete Task action to your flow.
  4. Configure the "Delete Task" action with the following settings:
    • Connection: Select your pre-configured Asana connection.
    • Project: Choose the "Content Pipeline" project from the dropdown list.
    • Task Id: Use the token picker to dynamically insert the Task ID from the updated row in your Google Sheet trigger.

Outcome: This automation ensures that the Asana project board is always an accurate reflection of active work. When a content request is canceled, the associated task is instantly and automatically removed, preventing confusion and saving the project manager from having to manually clean up the board. This keeps the team focused on valid tasks and maintains data integrity between the request sheet and Asana.


Best Practices

  1. Incorporate an Approval Step Since task deletion is permanent, consider adding an approval action before this step for critical workflows. This sends a confirmation request to a manager to prevent accidental deletion of important tasks.
  2. Use Dynamic Tokens for Task IDs Avoid hardcoding the Task ID. Always use the token picker to pass the ID from a trigger or a preceding action (like 'Find Task'). This makes your workflow robust, reusable, and less prone to errors.
  3. Log Deletion Events For auditing purposes, add a step after the Delete Task action to log the event. Record the deleted Task ID, project name, and a timestamp in a Google Sheet or send a notification to a logging channel to maintain a clear audit trail.
  4. Implement Error Handling The action will fail if the task has already been deleted manually. Configure zenphi's error handling settings for this step to catch such errors and allow the flow to continue gracefully, for instance, by logging that the task was already missing.