{
  "name": "WF1 - Formulario de Contacto Inteligente",
  "flow": [
    {
      "id": 1,
      "module": "tally:watchNewResponse",
      "version": 1,
      "parameters": {},
      "mapper": {},
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        },
        "restore": {
          "parameters": {
            "__IMTHOOK__": {
              "data": {
                "editable": "false"
              },
              "label": "Your Tally webhook"
            }
          }
        },
        "parameters": [
          {
            "name": "__IMTHOOK__",
            "type": "hook:tally",
            "label": "Webhook",
            "required": true
          }
        ],
        "interface": [
          {
            "name": "eventId",
            "type": "text",
            "label": "Event ID"
          },
          {
            "name": "responseId",
            "type": "text",
            "label": "Response ID"
          },
          {
            "name": "submissionId",
            "type": "text",
            "label": "Submission ID"
          },
          {
            "name": "respondentId",
            "type": "text",
            "label": "Respondent ID"
          },
          {
            "name": "formId",
            "type": "text",
            "label": "Form ID"
          },
          {
            "name": "formName",
            "type": "text",
            "label": "Form Name"
          },
          {
            "name": "createdAt",
            "type": "date",
            "label": "Created at"
          },
          {
            "name": "fields",
            "spec": [
              {
                "name": "Name",
                "type": "text"
              },
              {
                "name": "Email",
                "type": "email"
              },
              {
                "name": "Subject",
                "type": "text"
              },
              {
                "name": "Message",
                "type": "text"
              }
            ],
            "type": "collection",
            "label": "Fields"
          },
          {
            "name": "fieldsById",
            "spec": [
              {
                "name": "question_REPLACE_WITH_YOUR_NAME_FIELD_ID",
                "type": "text",
                "label": "Name"
              },
              {
                "name": "question_REPLACE_WITH_YOUR_EMAIL_FIELD_ID",
                "type": "email",
                "label": "Email"
              },
              {
                "name": "question_REPLACE_WITH_YOUR_SUBJECT_FIELD_ID",
                "type": "text",
                "label": "Subject"
              },
              {
                "name": "question_REPLACE_WITH_YOUR_MESSAGE_FIELD_ID",
                "type": "text",
                "label": "Message"
              }
            ],
            "type": "collection",
            "label": "Fields by ID"
          }
        ]
      }
    },
    {
      "id": 2,
      "module": "openai-gpt-3:CreateCompletion",
      "version": 1,
      "parameters": {},
      "mapper": {
        "model": "gpt-4o-mini",
        "top_p": "1",
        "select": "chat",
        "messages": [
          {
            "role": "system",
            "content": "Eres un asistente de atención al cliente para una pequeña empresa.\nEscribe respuestas amigables y profesionales a las consultas de los clientes.\nSé personal: haz referencia a su pregunta específica.\nMáximo 2-3 párrafos. Siempre ofrece un siguiente paso claro.\n"
          },
          {
            "role": "user",
            "content": "Nueva consulta recibida:\nNombre: {{1.fieldsById.question_REPLACE_WITH_YOUR_NAME_FIELD_ID}}\nEmail: {{1.fieldsById.question_REPLACE_WITH_YOUR_EMAIL_FIELD_ID}}\nAsunto: {{1.fieldsById.question_REPLACE_WITH_YOUR_SUBJECT_FIELD_ID}}\nMensaje: {{1.fieldsById.question_REPLACE_WITH_YOUR_MESSAGE_FIELD_ID}}\nEscribe una respuesta personalizada a esta consulta.\n\n",
            "imageDetail": "auto"
          }
        ],
        "temperature": "0.7",
        "n_completions": "1",
        "response_format": "text"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        },
        "restore": {
          "expect": {
            "stop": {
              "mode": "chose"
            },
            "model": {
              "mode": "chose",
              "label": "gpt-4o-mini (system)Fast, affordable small model for focused tasks"
            },
            "select": {
              "label": "Create a Chat Completion (GPT and o1 models)"
            },
            "messages": {
              "mode": "chose",
              "items": [
                {
                  "role": {
                    "mode": "chose",
                    "label": "Developer / System"
                  }
                },
                {
                  "role": {
                    "mode": "chose",
                    "label": "User"
                  },
                  "imageDetail": {
                    "mode": "chose",
                    "label": "Auto"
                  },
                  "imageInputType": {
                    "mode": "chose",
                    "label": "Empty"
                  }
                }
              ]
            },
            "logit_bias": {
              "mode": "chose"
            },
            "max_tokens": {
              "empty": true
            },
            "tool_choice": {
              "mode": "chose",
              "label": "Empty"
            },
            "response_format": {
              "mode": "chose",
              "label": "Text"
            },
            "additionalParameters": {
              "mode": "chose"
            }
          },
          "parameters": {
            "__IMTCONN__": {
              "data": {
                "scoped": "true",
                "connection": "openai-gpt-3"
              },
              "label": "Your OpenAI connection"
            }
          }
        },
        "parameters": [
          {
            "name": "__IMTCONN__",
            "type": "account:openai-gpt-3",
            "label": "Connection",
            "required": true
          }
        ],
        "expect": [
          {
            "name": "select",
            "type": "select",
            "label": "Select Method",
            "required": true,
            "validate": {
              "enum": [
                "chat",
                "prompt"
              ]
            }
          },
          {
            "name": "temperature",
            "type": "number",
            "label": "Temperature",
            "validate": {
              "max": 2,
              "min": 0
            }
          },
          {
            "name": "top_p",
            "type": "number",
            "label": "Top P",
            "validate": {
              "max": 1,
              "min": 0
            }
          },
          {
            "name": "n_completions",
            "type": "number",
            "label": "Number"
          },
          {
            "name": "frequency_penalty",
            "type": "number",
            "label": "Frequency Penalty",
            "validate": {
              "max": 2,
              "min": -2
            }
          },
          {
            "name": "presence_penalty",
            "type": "number",
            "label": "Presence Penalty",
            "validate": {
              "max": 2,
              "min": -2
            }
          },
          {
            "name": "logit_bias",
            "spec": {
              "name": "value",
              "spec": [
                {
                  "name": "token",
                  "type": "text",
                  "label": "Token ID",
                  "required": true
                },
                {
                  "name": "probability",
                  "type": "number",
                  "label": "Probability",
                  "required": true,
                  "validate": {
                    "max": 100,
                    "min": -100
                  }
                }
              ],
              "type": "collection",
              "label": "Token Probability"
            },
            "type": "array",
            "label": "Token Probability"
          },
          {
            "name": "seed",
            "type": "integer",
            "label": "Seed"
          },
          {
            "name": "tool_choice",
            "type": "select",
            "label": "Tool Choice",
            "validate": {
              "enum": [
                "none",
                "auto",
                "required"
              ]
            }
          },
          {
            "name": "stop",
            "spec": {
              "name": "value",
              "type": "text",
              "label": "Stop Sequence"
            },
            "type": "array",
            "label": "Stop Sequences",
            "validate": {
              "maxItems": 4
            }
          },
          {
            "name": "additionalParameters",
            "spec": {
              "name": "value",
              "spec": [
                {
                  "name": "key",
                  "type": "text",
                  "label": "Parameter Name",
                  "required": true
                },
                {
                  "name": "type",
                  "type": "select",
                  "label": "Input Type",
                  "options": [
                    {
                      "label": "Text",
                      "value": "text",
                      "nested": [
                        {
                          "name": "value",
                          "type": "text",
                          "label": "Parameter Value"
                        }
                      ],
                      "default": true
                    },
                    {
                      "label": "Number",
                      "value": "number",
                      "nested": [
                        {
                          "name": "value",
                          "type": "number",
                          "label": "Parameter Value"
                        }
                      ]
                    },
                    {
                      "label": "Boolean",
                      "value": "boolean",
                      "nested": [
                        {
                          "name": "value",
                          "type": "boolean",
                          "label": "Parameter Value"
                        }
                      ]
                    },
                    {
                      "label": "Date",
                      "value": "date",
                      "nested": [
                        {
                          "name": "value",
                          "type": "date",
                          "label": "Parameter Value"
                        }
                      ]
                    },
                    {
                      "label": "Any",
                      "value": "any",
                      "nested": [
                        {
                          "name": "value",
                          "type": "any",
                          "label": "Parameter Value"
                        }
                      ]
                    }
                  ]
                }
              ],
              "type": "collection",
              "label": "Input Parameter"
            },
            "type": "array",
            "label": "Other Input Parameters"
          },
          {
            "name": "model",
            "type": "select",
            "label": "Model",
            "required": true
          },
          {
            "name": "max_tokens",
            "type": "uinteger",
            "label": "Max Output Tokens"
          },
          {
            "name": "messages",
            "spec": {
              "name": "value",
              "spec": [
                {
                  "name": "role",
                  "type": "select",
                  "label": "Role",
                  "options": {
                    "store": [
                      {
                        "label": "User",
                        "value": "user",
                        "nested": [
                          {
                            "help": "Text content of the message on behalf of the selected __Role__.",
                            "name": "content",
                            "type": "text",
                            "label": "Text Content"
                          },
                          {
                            "name": "imageInputType",
                            "type": "select",
                            "label": "Image Input Type",
                            "options": [
                              {
                                "label": "URL",
                                "value": "url",
                                "nested": [
                                  {
                                    "help": "Make sure to use a publicly accessible URL.\nYou can test if your image is publicly accessible by opening the link in an incognito tab.",
                                    "name": "imageUrl",
                                    "type": "url",
                                    "label": "Image URL"
                                  }
                                ]
                              },
                              {
                                "label": "Image File",
                                "value": "file",
                                "nested": [
                                  {
                                    "name": "imageFile",
                                    "spec": [
                                      {
                                        "help": "Accepted extensions: `.jpg`, `.jpeg`, `.png`, `.webp` and `.gif`.",
                                        "name": "imageFilename",
                                        "type": "filename",
                                        "label": "Image Filename",
                                        "semantic": "file:name",
                                        "extension": [
                                          "jpg",
                                          "jpeg",
                                          "png",
                                          "webp",
                                          "gif"
                                        ]
                                      },
                                      {
                                        "name": "imageData",
                                        "type": "buffer",
                                        "label": "Image Data",
                                        "semantic": "file:data"
                                      }
                                    ],
                                    "type": "collection",
                                    "label": "Image"
                                  }
                                ]
                              }
                            ],
                            "mappable": false
                          },
                          {
                            "help": "Recommended value: `Auto`",
                            "name": "imageDetail",
                            "type": "select",
                            "label": "Image Detail",
                            "options": [
                              {
                                "label": "Auto",
                                "value": "auto",
                                "default": true
                              },
                              {
                                "label": "High",
                                "value": "high"
                              },
                              {
                                "label": "Low",
                                "value": "low"
                              }
                            ]
                          }
                        ],
                        "default": true
                      },
                      {
                        "label": "Assistant",
                        "value": "assistant",
                        "nested": [
                          {
                            "help": "Text content of the message on behalf of the selected __Role__.",
                            "name": "content",
                            "type": "text",
                            "label": "Text Content"
                          },
                          {
                            "mode": "edit",
                            "name": "tool_calls",
                            "spec": {
                              "spec": [
                                {
                                  "name": "type",
                                  "type": "hidden",
                                  "default": "function"
                                },
                                {
                                  "help": "Map this directly from the output of a previous **Create a Completion** module. Look for `Choices[]: Message.Tool Calls[]: ID`.",
                                  "name": "id",
                                  "type": "text",
                                  "label": "Tool call ID"
                                },
                                {
                                  "name": "function",
                                  "spec": [
                                    {
                                      "help": "The name of the function previously called.",
                                      "name": "name",
                                      "type": "text",
                                      "label": "Name",
                                      "required": true
                                    },
                                    {
                                      "help": "The arguments previously output by the AI.",
                                      "name": "arguments",
                                      "type": "text",
                                      "label": "Arguments",
                                      "required": true
                                    }
                                  ],
                                  "type": "collection",
                                  "label": "Function"
                                }
                              ],
                              "type": "collection",
                              "label": "Tool Call"
                            },
                            "type": "array",
                            "label": "Tool Calls",
                            "labels": {
                              "add": "Add tool call"
                            },
                            "mappable": {
                              "help": "You can map the entire `Choices[]: Message.Tool Calls` array from a previous Create a Completion module here."
                            }
                          }
                        ]
                      },
                      {
                        "label": "Developer / System",
                        "value": "system",
                        "nested": [
                          {
                            "help": "Text content of the message on behalf of the selected __Role__.",
                            "name": "content",
                            "type": "text",
                            "label": "Text Content"
                          }
                        ]
                      },
                      {
                        "label": "Tool",
                        "value": "tool",
                        "nested": [
                          {
                            "help": "The return of the function. This role should only be used when you have processed a previous function call and want to send the output of the function execution back to the AI.",
                            "name": "content",
                            "type": "text",
                            "label": "Text Content",
                            "required": true
                          },
                          {
                            "help": "Map this directly from the output of a previous **Create a Completion** module. Look for `Choices[]: Message.Tool Calls[]: ID`.",
                            "name": "tool_call_id",
                            "type": "text",
                            "label": "Tool Call ID.",
                            "required": true
                          }
                        ]
                      }
                    ]
                  },
                  "required": true
                }
              ],
              "type": "collection",
              "label": "Message"
            },
            "type": "array",
            "label": "Messages",
            "required": true
          },
          {
            "name": "response_format",
            "type": "select",
            "label": "Response Format",
            "validate": {
              "enum": [
                "text",
                "json_object"
              ]
            }
          },
          {
            "name": "prediction",
            "type": "text",
            "label": "Predicted Outputs"
          }
        ],
        "interface": [
          {
            "name": "result",
            "type": "any",
            "label": "Result"
          },
          {
            "name": "id",
            "type": "text",
            "label": "ID"
          },
          {
            "name": "object",
            "type": "text",
            "label": "Object"
          },
          {
            "name": "created",
            "type": "date",
            "label": "Created"
          },
          {
            "name": "model",
            "type": "text",
            "label": "Model"
          },
          {
            "name": "choices",
            "spec": [
              {
                "name": "text",
                "type": "text",
                "label": "Text"
              },
              {
                "name": "index",
                "type": "number",
                "label": "Index"
              },
              {
                "name": "logprobs",
                "type": "text",
                "label": "Log Probs"
              },
              {
                "name": "finish_reason",
                "type": "text",
                "label": "Finish Reason"
              },
              {
                "name": "message",
                "spec": [
                  {
                    "name": "role",
                    "type": "text",
                    "label": "Role"
                  },
                  {
                    "name": "content",
                    "type": "text",
                    "label": "Content"
                  },
                  {
                    "name": "tool_calls",
                    "spec": [
                      {
                        "name": "id",
                        "type": "text",
                        "label": "ID"
                      },
                      {
                        "name": "type",
                        "type": "text",
                        "label": "Type"
                      },
                      {
                        "name": "function",
                        "spec": [
                          {
                            "name": "name",
                            "type": "text",
                            "label": "Name"
                          },
                          {
                            "name": "arguments",
                            "type": "text",
                            "label": "Arguments"
                          }
                        ],
                        "type": "collection",
                        "label": "Function"
                      }
                    ],
                    "type": "array",
                    "label": "Tool Calls"
                  },
                  {
                    "name": "refusal",
                    "type": "text",
                    "label": "Refusal"
                  },
                  {
                    "name": "annotations",
                    "spec": [
                      {
                        "name": "type",
                        "type": "text",
                        "label": "Type"
                      },
                      {
                        "name": "url_citation",
                        "spec": [
                          {
                            "name": "end_index",
                            "type": "number",
                            "label": "End Index"
                          },
                          {
                            "name": "start_index",
                            "type": "number",
                            "label": "Start Index"
                          },
                          {
                            "name": "title",
                            "type": "text",
                            "label": "Title"
                          },
                          {
                            "name": "url",
                            "type": "text",
                            "label": "URL"
                          }
                        ],
                        "type": "collection",
                        "label": "URL Citation"
                      }
                    ],
                    "type": "array",
                    "label": "Annotations"
                  }
                ],
                "type": "collection",
                "label": "Message"
              }
            ],
            "type": "array",
            "label": "Choices"
          },
          {
            "name": "usage",
            "spec": [
              {
                "name": "prompt_tokens",
                "type": "number",
                "label": "Prompt Tokens"
              },
              {
                "name": "completion_tokens",
                "type": "text",
                "label": "Completion Tokens"
              },
              {
                "name": "total_tokens",
                "type": "number",
                "label": "Total Tokens"
              },
              {
                "name": "prompt_tokens_details",
                "spec": [
                  {
                    "name": "cached_tokens",
                    "type": "uinteger",
                    "label": "Cached Tokens"
                  },
                  {
                    "name": "text_tokens",
                    "type": "uinteger",
                    "label": "Text Tokens"
                  },
                  {
                    "name": "image_tokens",
                    "type": "uinteger",
                    "label": "Image Tokens"
                  },
                  {
                    "name": "audio_tokens",
                    "type": "uinteger",
                    "label": "Audio Tokens"
                  }
                ],
                "type": "collection",
                "label": "Prompt Tokens Details"
              },
              {
                "name": "completion_tokens_details",
                "spec": [
                  {
                    "name": "reasoning_tokens",
                    "type": "uinteger",
                    "label": "Reasoning Tokens"
                  },
                  {
                    "name": "text_tokens",
                    "type": "uinteger",
                    "label": "Text Tokens"
                  },
                  {
                    "name": "audio_tokens",
                    "type": "uinteger",
                    "label": "Audio Tokens"
                  },
                  {
                    "name": "accepted_prediction_tokens",
                    "type": "uinteger",
                    "label": "Accepted Prediction Tokens"
                  },
                  {
                    "name": "rejected_prediction_tokens",
                    "type": "uinteger",
                    "label": "Rejected Prediction Tokens"
                  }
                ],
                "type": "collection",
                "label": "Completion Tokens Details"
              }
            ],
            "type": "collection",
            "label": "Usage"
          },
          {
            "name": "service_tier",
            "type": "text",
            "label": "Service Tier"
          },
          {
            "name": "system_fingerprint",
            "type": "text",
            "label": "System Fingerprint"
          }
        ],
        "advanced": true
      }
    },
    {
      "id": 3,
      "module": "email:ActionSendEmail",
      "version": 7,
      "parameters": {
        "saveAfterSent": false
      },
      "mapper": {
        "cc": [],
        "to": [
          "{{1.fields.Email}}"
        ],
        "bcc": [],
        "from": "",
        "html": "<p>Hola {{1.fieldsById.question_REPLACE_WITH_YOUR_NAME_FIELD_ID}},</p>\n{{2.result}}\n<p>Saludos,<br><strong>[Tu Nombre]</strong></p>\n",
        "sender": "",
        "headers": [],
        "replyTo": "",
        "subject": "{{1.fieldsById.question_REPLACE_WITH_YOUR_SUBJECT_FIELD_ID}}",
        "priority": "normal",
        "inReplyTo": "",
        "references": [],
        "attachments": [],
        "contentType": "html"
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        },
        "restore": {
          "expect": {
            "cc": {
              "mode": "chose"
            },
            "to": {
              "mode": "chose",
              "items": [
                null
              ]
            },
            "bcc": {
              "mode": "chose"
            },
            "priority": {
              "label": "Normal"
            },
            "references": {
              "mode": "chose"
            },
            "attachments": {
              "mode": "chose"
            },
            "contentType": {
              "label": "HTML"
            }
          },
          "parameters": {
            "account": {
              "data": {
                "scoped": "true",
                "connection": "smtp"
              },
              "label": "Your SMTP email connection"
            },
            "saveAfterSent": {
              "label": "No"
            }
          }
        },
        "parameters": [
          {
            "name": "account",
            "type": "account:smtp,google-restricted,microsoft-smtp-imap",
            "label": "Connection",
            "required": true
          },
          {
            "name": "saveAfterSent",
            "type": "select",
            "label": "Save message after sending",
            "required": true,
            "validate": {
              "enum": [
                true,
                false
              ]
            }
          }
        ],
        "expect": [
          {
            "name": "to",
            "spec": {
              "name": "value",
              "type": "email",
              "label": "Email address",
              "required": true
            },
            "type": "array",
            "label": "To",
            "required": true
          },
          {
            "name": "subject",
            "type": "text",
            "label": "Subject"
          },
          {
            "name": "contentType",
            "type": "select",
            "label": "Content Type",
            "required": true,
            "validate": {
              "enum": [
                "html",
                "text"
              ]
            }
          },
          {
            "name": "attachments",
            "spec": [
              {
                "name": "fileName",
                "type": "filename",
                "label": "File name",
                "required": true,
                "semantic": "file:name"
              },
              {
                "name": "data",
                "type": "buffer",
                "label": "Data",
                "required": true,
                "semantic": "file:data"
              },
              {
                "name": "cid",
                "type": "text",
                "label": "Content-ID"
              }
            ],
            "type": "array",
            "label": "Attachments"
          },
          {
            "name": "cc",
            "spec": {
              "name": "value",
              "type": "email",
              "label": "Email address"
            },
            "type": "array",
            "label": "Copy recipient"
          },
          {
            "name": "bcc",
            "spec": {
              "name": "value",
              "type": "email",
              "label": "Email address"
            },
            "type": "array",
            "label": "Blind copy recipient"
          },
          {
            "name": "from",
            "type": "text",
            "label": "From"
          },
          {
            "name": "sender",
            "type": "text",
            "label": "Sender"
          },
          {
            "name": "replyTo",
            "type": "text",
            "label": "Reply-To"
          },
          {
            "name": "inReplyTo",
            "type": "text",
            "label": "In-Reply-To"
          },
          {
            "name": "references",
            "spec": {
              "name": "value",
              "type": "text",
              "label": "Reference",
              "required": true
            },
            "type": "array",
            "label": "References"
          },
          {
            "name": "priority",
            "type": "select",
            "label": "Priority",
            "validate": {
              "enum": [
                "high",
                "normal",
                "low"
              ]
            }
          },
          {
            "name": "headers",
            "spec": [
              {
                "name": "key",
                "type": "text",
                "label": "Key",
                "required": true
              },
              {
                "name": "value",
                "type": "text",
                "label": "Value",
                "required": true
              }
            ],
            "type": "array",
            "label": "Headers"
          },
          {
            "name": "html",
            "type": "text",
            "label": "Content"
          }
        ]
      }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu1.make.com",
    "notes": []
  }
}