{
  "name": "Client documents to their folder",
  "description": "Classifies attachments with AI and saves them to the client file.",
  "tags": [
    "Services"
  ],
  "pieces": [
    "@flooows/component-gmail",
    "@flooows/component-openai",
    "@flooows/component-google-drive"
  ],
  "template": {
    "displayName": "Client documents to their folder",
    "trigger": {
      "name": "trigger",
      "type": "PIECE_TRIGGER",
      "valid": false,
      "displayName": "Email with attachments",
      "settings": {
        "pieceName": "@flooows/component-gmail",
        "pieceVersion": "~0.18.6",
        "pieceType": "OFFICIAL",
        "packageType": "REGISTRY",
        "triggerName": "new_attachment",
        "input": {},
        "inputUiInfo": {},
        "propertySettings": {}
      },
      "nextAction": {
        "name": "step_1",
        "type": "PIECE",
        "valid": false,
        "skip": false,
        "displayName": "Classify the document",
        "settings": {
          "pieceName": "@flooows/component-openai",
          "pieceVersion": "~0.13.2",
          "pieceType": "OFFICIAL",
          "packageType": "REGISTRY",
          "actionName": "classify_text",
          "input": {
            "model": "gpt-4o-mini",
            "input": "{{trigger.subject}} · {{trigger.attachments[0].fileName}}"
          },
          "inputUiInfo": {},
          "propertySettings": {},
          "errorHandlingOptions": {
            "retryOnFailure": {
              "value": true
            },
            "continueOnFailure": {
              "value": false
            }
          }
        },
        "nextAction": {
          "name": "step_2",
          "type": "PIECE",
          "valid": false,
          "skip": false,
          "displayName": "Save it in the customer's folder",
          "settings": {
            "pieceName": "@flooows/component-google-drive",
            "pieceVersion": "~0.13.3",
            "pieceType": "OFFICIAL",
            "packageType": "REGISTRY",
            "actionName": "upload_gdrive_file",
            "input": {
              "fileName": "{{step_1}} · {{trigger.attachments[0].fileName}}",
              "file": "{{trigger.attachments[0]}}"
            },
            "inputUiInfo": {},
            "propertySettings": {},
            "errorHandlingOptions": {
              "retryOnFailure": {
                "value": true
              },
              "continueOnFailure": {
                "value": false
              }
            }
          }
        }
      }
    },
    "valid": false,
    "schemaVersion": "1"
  },
  "blogUrl": "https://flooows.com/en/templates/customer-documents-to-folder",
  "metadata": {
    "publisher": "flooows",
    "lang": "en",
    "setupMinutes": 6,
    "creditsPerRun": 3
  }
}