GPTs의 actions 기능과 Zapier의 AI actions를 이용하여 Notion DB 업데이트 및 주간 월간 분석 리포트 받기

소개

MAKE로 이전에 했던 버전을 Zapier로 하는게 쉬울 것 같아 시도하게 되었습니다.

GPTs와 영어 공부한 내용 요약하여 매일 노션에 업데이트 하고

공부한 데이터가 쌓이면 주간 월간 리포트를 받는 것까지가 목표입니다.

진행 방법

GPTs의 actions 기능과 Zapier의 AI actions를 이용하여 진행하였습니다.

  1. 시나리오는 GPTs와 영어로 대화한 내용을 요약해서 Notion에 업데이트 해 달라고 요청하면

GPTs가 요약해서 Zapier에게 보내면 Zapier에서 Notion DB를 업데이트하는 것

  1. 그리고 데이터가 쌓여서 언제부터 언제까지 데이터 분석해서 리포트를 달라고 GPTs에 요청하면 Zapier에서 Notion 데이터를 GPTs로 보내주면 GPTs가 받아서 분석 후 리포트를 받는 것입니다.


먼저 Notion DB를 만들고

다음으로 GPTs를 만듭니다.

새작업 만들기 버튼을 눌러서 스키마를 불러옵니다.

https://actions.zapier.com/docs/platform/gpt/

위의 링크로 들어가서 아래 링크를 복사합니다.

시작 페이지의 스크린 샷
한국어 웹 사이트의 스크린 샷

URL에서 가져오기를 누를 후 위의 링크 복사한 것을 넣어주면 아래 처럼 스키마를 가져올 수 있습니다.

{
  "openapi": "3.1.0",
  "info": {
    "title": "Zapier AI Actions for GPT (Dynamic)",
    "version": "1.0.0",
    "description": "Equip GPTs with the ability to run thousands of actions via Zapier. ()",
    "x-openai-verification-token": ""
  },
  "servers": [
    {
      "url": "https://actions.zapier.com"
    }
  ],
  "paths": {
    "/gpt/api/v1/available/": {
      "get": {
        "operationId": "list_available_actions",
        "summary": "List Available Actions",
        "parameters": [
          {
            "in": "query",
            "name": "apps",
            "schema": {
              "description": "Optional comma-separated list of app names to filter the available actions.",
              "title": "Apps",
              "type": "string"
            },
            "required": false,
            "description": "Optional comma-separated list of app names to filter the available actions."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableActionResponseSchema"
                }
              }
            }
          }
        },
        "description": "List all the currently available actions for the user. If you try to run an action and receive an error\nthat it does not exist, try refreshing this list first.",
        "security": [
          {
            "AccessPointOAuth": []
          }
        ]
      }
    },
    "/gpt/api/v1/available/{available_action_id}/run/": {
      "post": {
        "operationId": "run_action",
        "summary": "Run Action",
        "parameters": [
          {
            "in": "path",
            "name": "available_action_id",
            "schema": {
              "description": "The ID of the action to execute.",
              "title": "Available Action Id",
              "type": "string"
            },
            "required": true,
            "description": "The ID of the action to execute."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Run an available action. The request body should contain `instructions` and optionally `preview_only`.\nAll other action-specific parameters must be placed within the `params_hints` object in the request body.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "AccessPointOAuth": []
          }
        ]
      }
    },
    "/gpt/api/v1/zap-guesser/": {
      "get": {
        "operationId": "zap_guesser",
        "summary": "Zap Guesser",
        "parameters": [
          {
            "in": "query",
            "name": "prompt",
            "schema": {
              "title": "Prompt",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "AccessPointOAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AvailableActionResponseSchema": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/AvailableActionSchema"
            },
            "title": "Results",
            "type": "array"
          }
        },
        "required": [
          "results"
        ],
        "title": "AvailableActionResponseSchema",
        "type": "object"
      },
      "AvailableActionSchema": {
        "properties": {
          "id": {
            "description": "The unique ID of the available action.",
            "title": "Id",
            "type": "string"
          },
          "operation_id": {
            "description": "The operation ID of the available action.",
            "title": "Operation Id",
            "type": "string"
          },
          "description": {
            "description": "Description of the action.",
            "title": "Description",
            "type": "string"
          },
          "params": {
            "description": "Available hint fields for the action.",
            "title": "Params",
            "type": "object"
          },
          "configuration_link": {
            "description": "Guide the user to setup new actions with the configuration_link. You can optionally add ?setup_action=... onto configuration_link to set up a specific Zapier app and action. For example: https://actions.zapier.com/gpt/start?setup_action=gmail find email",
            "title": "Configuration Link",
            "type": "string"
          }
        },
        "required": [
          "id",
          "operation_id",
          "description",
          "params",
          "configuration_link"
        ],
        "title": "AvailableActionSchema",
        "type": "object"
      },
      "RunResponse": {
        "description": "This is a summary of the results given the action that was run.",
        "properties": {
          "id": {
            "description": "The id of the run log.",
            "title": "Id",
            "type": "string"
          },
          "action_used": {
            "description": "The name of the action that was run.",
            "title": "Action Used",
            "type": "string"
          },
          "input_params": {
            "description": "The params we used / will use to run the action.",
            "title": "Input Params",
            "type": "object"
          },
          "review_url": {
            "description": "The URL to run the action or review the AI choices the AI made for input_params given instructions.",
            "title": "Review Url",
            "type": "string"
          },
          "result": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "A trimmed down result of the first item of the full results. Ideal for humans and language models!",
            "title": "Result"
          },
          "additional_results": {
            "description": "The rest of the full results. Always returns an array of objects",
            "items": {
              "type": "object"
            },
            "title": "Additional Results",
            "type": "array"
          },
          "result_field_labels": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human readable labels for some of the keys in the result.",
            "title": "Result Field Labels"
          },
          "status": {
            "default": "success",
            "description": "The status of the action run.",
            "enum": [
              "success",
              "error",
              "empty",
              "preview"
            ],
            "title": "Status",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The error message if the action run failed.",
            "title": "Error"
          },
          "assistant_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A hint for the assistant on what to do next.",
            "title": "Assistant Hint"
          },
          "full_results": {
            "description": "The full results, not summarized, if available. Always returns an array of objects.",
            "items": {
              "type": "object"
            },
            "title": "Full Results",
            "type": "array"
          }
        },
        "required": [
          "id",
          "action_used",
          "input_params",
          "review_url",
          "additional_results",
          "full_results"
        ],
        "title": "RunResponse",
        "type": "object"
      },
      "ErrorResponse": {
        "additionalProperties": true,
        "properties": {
          "error": {
            "description": "Error message.",
            "title": "Error",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "RunRequest": {
        "additionalProperties": true,
        "description": "Try and stuff as much relevant information into the instructions as possible.\nSet any necessary AvailableActionSchema params within the `params_hints` object.",
        "properties": {
          "instructions": {
            "description": "Plain English instructions. Provide as much detail as possible.",
            "title": "Instructions",
            "type": "string"
          },
          "params_hints": {
            "description": "Hints about action-specific parameters.",
            "properties": {},
            "title": "Params Hints",
            "type": "object"
          },
          "preview_only": {
            "default": false,
            "description": "If true, return a preview instead of executing the action.",
            "title": "Preview Only",
            "type": "boolean"
          }
        },
        "required": [
          "instructions"
        ],
        "title": "RunRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "AccessPointOAuth": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/oauth/authorize/",
            "tokenUrl": "/oauth/token/",
            "scopes": {
              "nla:exposed_actions:execute": "Run AI Actions",
              "openid": "OpenID Connect scope"
            }
          }
        }
      }
    }
  }
}

그리고 구성으로 돌아온 후 지침에 아래 프롬프트를 넣어 줍니다.

### Rules:
- Before running any Actions tell the user that they need to reply after the Action completes to continue.

### Instructions for Zapier AI Actions:
Step 1. Check for required action(s):
    - Call `list_available_actions` to generate available actions list
    - If required action exists → Step 4
    - If not → Step 2
Step 2. For missing required action(s):
    - Send configuration link
    - Wait for user to confirm they've configured the required action
Step 3. After user confirms configuration → proceed to Step 4 with original request
Step 4. Execute `run_action`:
    - Use the action ID from the results array of the `list_available_actions` response
    - Fill in required parameters based on user request

Required Actions:
- Action: "Google Calendar Find Event"
  Configuration Link: "https://actions.zapier.com/gpt/start?setup_action=google%20calendar%20find%20event&setup_params=set%20have%20AI%20guess%20for%20Start%20and%20End%20time"
- Action: "Gmail Create Draft"
  Configuration Link: "https://actions.zapier.com/gpt/start?setup_action=gmail%20create%20draft%20"

프롬프트 내용은 어떤 지시를 받으면 어떤 행동을 수행하라는 형식입니다.

예시에 있는 Required Actions를 내가 원하는 것으로 만들어주어야합니다.

AI 액션 페이지의 스크린 샷

My actions 클릭하여 manage actions을 클릭하면

Google 캘린더 설정의 스크린 샷

add a new action

notion : create database item 선택하고

FTP 섹션이있는 페이지의 스크린 샷

오팔 이메일 설정의 스크린 샷

Notion Account를 클릭해서 notion과 zapier를 연결시켜야합니다.

연결된 후 show all options을 클릭해서

PSD 파일을 생성하는 옵션이있는 PSD 파일의 스크린 샷

Database에서 set a specific value for this field를 선택한 후

DB를 내가 만든 Notion DB를 선택하고

나머지는 set a specific value for this field를 클릭해서 속성 값을 넣어주셔도 되고

저는 Have AI guess a value for this field라고 설정했었는데 별 무리없이 수행이 됩니다.

안되는 건 chatGPT에게 물어가며 수행했습니다.

Google Analytics 대시 보드의 스크린 샷

이렇게 설정한 후 prompt에서 Action을 수정을 해줘야 합니다.

Notion create database Item으로 수정하고 Link를 아래 화면의 주소창을 복사해서 넣어주면 됩니다.

PDF를 다운로드하는 버튼이있는 웹 페이지의 스크린 샷

- Action: "Notion: Create Database Item" 

  Configuration Link: "https://actions.zapier.com/gpt/action/4c01ba-4298-a6da-07712d/"

- Action: "Notion: Find Database Item"

  Configuration Link: "https://actions.zapier.com/gpt/action/afb10c-4ee0-a706-baf3a5/"

하나는 Notion DB에 업데이트 하는 action 또 하나는 DB 분석을 위한 action입니다.

이렇게 설정하고 Rule 위쪽에 prompt 생성기로 작성한 prompt를 넣어 완성하였습니다.

결과와 배운 점

한국어 텍스트가있는 종이 한 장

한국어 웹 사이트의 스크린 샷

GPTs Action 기능과 Zapier AI actions을 활용하면 쉽게 나만의 비서 기능을 만들수 있겠다는 생각이 들었습니다.

그런데 며칠 사용하다보니 오류가 많습니다. ㅠㅠ

그래서 추가로 비서 GPTs도 만들어서 구글 캘린더에 일정 생성 삭제도 해봤는데 무리 없이 가능했습니다만 음성으로는 잘 안되는 것 같습니다. ㅜㅜ

GPTs와 대화 내용도 노션에 쉽게 업데이트 할 수 있어서 활용도가 매우 높을 것 같습니다.

도움 받은 글 (옵션)

아래 유튜브 영상을 참고하여 만들었습니다.

https://www.youtube.com/watch?v=2NXUxf5y0Mw

https://actions.zapier.com/docs/platform/gpt/

자세한 사항은 위의 링크를 참고하시면 됩니다.

3
3개의 답글

👉 이 게시글도 읽어보세요