{
  "schema_version": "1.0.0",
  "id": "starred-email-to-asana",
  "title": "Star an email to make it an Asana task",
  "category": "ops",
  "difficulty": "beginner",
  "featured": false,
  "description": "Starring an email in Gmail creates an Asana task with the subject, sender, and a link back, then labels the email so it is not added twice.",
  "tags": [
    "gmail",
    "asana",
    "tasks",
    "inbox"
  ],
  "apps": [
    "Gmail",
    "Asana"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 2 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Gmail",
    "event": "New Starred Email",
    "kind": "polling",
    "title": "Email starred",
    "why": "Fires when you star an email. One click in Gmail is the whole interface.",
    "config": {},
    "outputs": [
      "message_id",
      "thread_id",
      "from_email",
      "from_name",
      "to",
      "subject",
      "date",
      "body_plain",
      "snippet",
      "labels",
      "attachment_count",
      "attachment_names"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "task",
      "kind": "action",
      "app": "Asana",
      "event": "Create Task",
      "title": "Create the Asana task",
      "why": "Puts the request in your My Tasks with the email link, so the context is one click away.",
      "fields": {
        "Workspace": "YOUR_ASANA_WORKSPACE",
        "Project": "Inbox requests",
        "Name": "{{trigger.subject}}",
        "Assignee": "me",
        "Due On": "in 3 days",
        "Notes": "From {{trigger.from_name}} ({{trigger.from_email}})\n\n{{trigger.snippet}}\n\nEmail: https://mail.google.com/mail/u/0/#all/{{trigger.message_id}}"
      },
      "outputs": [
        "id",
        "permalink_url"
      ]
    },
    {
      "key": "label",
      "kind": "action",
      "app": "Gmail",
      "event": "Add Label to Email",
      "title": "Label the email as tasked",
      "why": "The label shows which starred emails already have a task, and stops a re-star from making a duplicate.",
      "fields": {
        "Message": "{{trigger.message_id}}",
        "Labels": "In Asana"
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
