Use this template

Syncing Asana tasks to Google tasks

Overview

This workflow template integrates and syncs Asana tasks into a Google task list. This is a one-way sync from Asana to Google Tasks.

Why should you use this template

How the template works

  1. Utilizing an Asana webhook to trigger the syncing of tasks to Google Tasks.

  2. For each event, if:

    • The task is new, create a new task in Google Tasks; or

    • The task has been updated, update the task in Google Tasks; or

    • The task is deleted, delete the task from Google Tasks.

  3. Following Asana task properties are synced to Google Tasks:

    • Task name

    • Task notes (text)

    • Task due date

    • Completed flag

Main workflow

Handle Events Map

How to use the template

Step 1: Create Asana OAuth 2.0 credentials

  1. Ensure you have set up Asana OAuth 2.0 and have access to client ID and client secret.

  2. Log in to the SimWorkflow.

  3. Navigate to Credentials.

  4. Click Create credentials button.

  5. Select OAuth 2.0 tab.

  6. Select Asana from the Provider dropdown.

  7. Enter Asana in the Name field.

  8. Enter the Client ID in the Client ID field.

  9. Enter the Client secret in the Client secret field.

  10. Click Create credentials button.

Step 2: Create Google Tasks OAuth 2.0 credentials

  1. Ensure you have set up Google Tasks OAuth 2.0 and have access to client ID and client secret.
  2. Log in to the SimWorkflow.
  3. Navigate to Credentials.
  4. Click Create credentials button.
  5. Select OAuth 2.0 tab.
  6. Select Google from the Provider dropdown.
  7. Enter Google Tasks in the Name field.
  8. Enter the Client ID in the Client ID field.
  9. Enter the Client secret in the Client secret field.
  10. Enter the following scopes in the Scopes field:
  11. Click Create credentials button.

Step 3: Create SimWorkflow Bearer token credentials

Step 3.1: Create SimWorkflow Personal access token

  1. Navigate to Settings > Personal access tokens.

  2. Enter SimWorkflow to the Name field.

  3. Enter 30 to the Token expiration in days fields.

  4. Click Create personal access token button.

  5. Copy the Token text.

Step 3.2: Create credentials

  1. Navigate to Credentials.

  2. Click Create credentials button.

  3. Select Bearer token tab.

  4. Enter SimWorkflow to the Name field.

  5. Paste the Token to the Bearer token field.

  6. Click Create credentials button.

Step 4: Use this workflow template

  1. Click Use this template button on the top right of this page.

  2. Enter the Handle Events Map task, by clicking on the down arrow icon.

  3. Select Configuration tab for the following tasks and select Asana (OAuth 2.0) for Credentials field:

    • Fetch Task
  4. Select Configuration tab for the following tasks and select Google Tasks (OAuth 2.0) for Credentials field:

    • Create Google Task
    • Update Google Task
    • Delete Task
  5. Select Configuration tab for the following tasks and select SimWorkflow (Bearer Token) for Credentials field:

    • Add to variables
    • Remove from variables
  6. Click Save button.

  7. Toggle the Enable checkbox to enable the workflow definition.

Step 5: Enable workflow definition webhook

  1. Navigate to Workflow definitions.

  2. Click Webhook settings menu item from the three dots (more options) menu of the Asana tasks to Google tasks workflow definition.

  3. Turn on Webhook on field.

  4. Copy the value of Webhook endpoint field. We'll use this endpoint to establish a webhook with Asana in the next step.

  5. Select a user for User to start the workflow as field.

  6. Enter the following code block for Verification request response field:

    {
      "headers": {
        "Content-Type": "text/plain",
        "x-hook-secret": "${headers['x-hook-secret']}",
        "X-Content-Type-Options": "nosniff"
      },
      "body": null
    }
    
  7. Click Save webhook settings button.

Step 6: Register workflow definition webhook with Asana

  1. Navigate to Workflow definitions.

  2. Click Create workflow definition button.

  3. Create HTTP Task and click on Configuration tab.

  4. Select Asana (OAuth 2.0) for Credentials field.

  5. Enter the following code block for HTTP request field:

    {
      "url": "https://app.asana.com/api/1.0/webhooks",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json"
      },
      "body": {
        "data": {
          "target": "REPLACE_WITH_WORFLOW_DEFINITION_WEBHOOK_ENDPOINT",
          "filters": [
            {
              "resource_type": "task"
            }
          ],
          "resource": "REPLACE_WITH_RESOURCE_ID"
        }
      }
    }
    
  6. Click Test request button to establish a webhook with Asana. Asana will send a POST request to the workflow definition webhook endpoint with HTTP header called X-Hook-Secret.

  7. Navigate to the Workflows of Asana tasks to Google tasks workflow definition.

  8. Open the first workflow and click on Input to open the workflow JSON input and locate the x-hook-secret in the headers field. Copy the value of x-hook-secret field.

Step 7: Define variables

  1. Navigate to Workflow definitions.

  2. Click Variables menu item from the three dots (more options) menu of the Asana tasks to Google tasks workflow definition.

Step 7.1: Google Task list ID

  1. Enter taskListId in the Variable key field.

  2. Enter the Google Task List ID to sync the tasks to in the Variable value field.

  3. Click Save variable button.

Step 7.2: Asana Webhook secret

  1. Enter asanaWebhookSecret in the Variable key field.

  2. Enter value of x-hook-secret in the Variable value field.

  3. Click Save variable button.

Step 8: Enable webhook payload validation

  1. Navigate to Workflow definitions.

  2. Click Webhook settings menu item from the three dots (more options) menu of the Asana tasks to Google tasks workflow definition.

  3. Enter the following code block for Validate the payload field:

    Swf.hmacSha256Hex($['swf:variables'].asanaWebhookSecret, $.body) === $.headers['x-hook-signature']
    
  4. Click Save webhook settings button.