Trigger Node

The Trigger Node is the starting point of a workflow. All workflows must start with a Trigger Node.


πŸ“‹ Trigger Node List

Node Description Usage Example
Text Input Start with text input Chatbot, Search
Click Start with a click Manual Execution
Telegram Webhook Start with Telegram Channel Post Telegram Channel Bot
Google Sheets Form Start on Google Sheets form submission Form Automation

Text Input

Starts the workflow with text input via an HTTP request

✨ Key Features

  • βœ… Receive text input from the user
  • βœ… Trigger workflow via HTTP GET/POST request
  • βœ… Pass input value to the next node
  • βœ… Pass text via URL parameter q

πŸ”§ Configuration

This node requires no special configuration. An HTTP endpoint is automatically generated when you deploy the workflow.

πŸ“‘ HTTP Request Example

GET Request (Using URL Parameter)

http://task.codefreeai.studio/task/run/{WORKFLOW_ID}?q=Hello

POST Request (Using JSON Body)

curl -X POST http://task.codefreeai.studio/task/run/{WORKFLOW_ID}?q=Hello

πŸ’‘ Usage Example

Creating an AI Chatbot

[Text Input] β†’ [ChatGPT] β†’ [Chatbot Response]
  1. User enters "Tell me the weather today"
  2. ChatGPT generates an answer
  3. Result returned

πŸ“ Result Data

Access the text value via {{result}} in the next node

Example: User enters "Hello" β†’ {{result}} is "Hello"


Click

Starts the workflow with a click or HTTP request

✨ Key Features

  • βœ… Run workflow with a button click
  • βœ… Execute immediately without input parameters
  • βœ… Manual trigger or API call

πŸ”§ Configuration

Used as a workflow run button without extra configuration.

πŸ“‘ HTTP Request Example

Call without parameters

http://task.codefreeai.studio/task/run/{WORKFLOW_ID}
curl -X GET http://task.codefreeai.studio/task/run/{WORKFLOW_ID}

πŸ’‘ Usage Example

Generating Daily News Summary

[Click] β†’ [HTTP Request] β†’ [ChatGPT] β†’ [Telegram]
  1. Button click
  2. Fetch latest news from News API
  3. AI generates summary
  4. Send to Telegram

Telegram Webhook

Starts the workflow with a Telegram Channel Post

✨ Key Features

  • βœ… Receive posts uploaded to a Telegram channel
  • βœ… Use post content as workflow input
  • βœ… Automate channel management

πŸ”§ Required Settings

Setting Description Example
API Key* Telegram Bot Token 123456:ABC-DEF...

πŸ“‹ Prerequisites

  1. Create Telegram Bot

    • Command /newbot to @BotFather
    • Set Bot name and username
    • Get Bot Token (Use as API Key)
  2. Channel Setup

    • Create a Telegram Channel (or use existing)
    • Invite the created Bot as an Administrator to the channel
    • (Important: Must have admin rights to read messages)
  3. Webhook Setup

    • Deploy workflow in CodeFreeAI
    • Telegram webhook is registered automatically

πŸ“‘ Received Data

Access the post text via {{result}} in the next node.

Important Limitation:

  • Only supports Channel Posts.
  • Direct messages (DM) to the bot or group chat messages are currently not supported.

Example: "Announcement" posted to channel β†’ {{result}} is "Announcement"

πŸ’‘ Usage Example

Channel Post Summary & Propagation

[Telegram Webhook] β†’ [ChatGPT] β†’ [Slack]
  1. Post news/announcement to Telegram channel
  2. ChatGPT summarizes and translates content
  3. Automatically forward to Slack team channel

Google Sheets Form

Starts the workflow when a Google Sheets form is submitted

✨ Key Features

  • βœ… Receive Google Forms responses in real-time
  • βœ… Auto-run whenever a new row is added
  • βœ… Pass form data to workflow (Array format)

πŸ”§ Configuration

This node does not require a separate API key. It automatically integrates with Google Sheets.

πŸ“‹ Prerequisites

To integrate CodeFreeAI with Google Sheets, Apps Script setup is required.

1. Google Forms & Setup

  1. Create Google Forms
    • Create a survey form in Google Forms
    • Link to Google Sheets in the "Responses" tab

2. Apps Script Setup

  1. Open Apps Script

    • In the Google Sheets menu, click Extensions > Apps Script.
  2. Add Library

    • Click the + button next to "Libraries" on the left.
    • Enter the following code in Script ID and click "Look up". 1vILl4o0Ttx6cWjB8jIcbwPzqD2hJNoU6dTWibFTCRxKYa17UT3j2LQjy
    • Confirm the Identifier is CodeFreeAIforSheets (default) and click "Add".
  3. Write Code

    • In the Code.gs editor, delete existing content and paste the code below.
    • Click πŸ’Ύ Save (Ctrl+S or Cmd+S).
    const $$ = CodeFreeAIforSheets;
    
    function onOpen() { $$.onOpen(); }
    function onEdit(e) { $$.onEdit(e); }
    function showSidebar() { $$.showSidebar(); }
    function getSettings() { return $$.getSettings(); }
    function processForm(u) { return $$.processForm(u); }
    function toggleTrigger(e) { return $$.toggleTrigger(e); }
    function onFormSubmitTriggerForCodeFree(e) { $$.onFormSubmitTriggerForCodeFree(e); }
    
  4. Finish and Setup (Register Webhook URL)

    • Return to the Google Sheets tab and refresh the page.
    • Click CodeFreeAI > Sidebar in the top menu.
    • Enter the API URL of your CodeFreeAI workflow and save.
    • Now, the workflow will automatically run when a form response is submitted.

πŸ“‘ Received Data

Receive form response data as a JSON String (List) via {{result}} in the next node.

Data Format: "['Timestamp', 'Response1', 'Response2', ...]"

Example: "['2024-01-20 10:30:00', 'John Doe', 'Inquiry Content']"

Note:

  • {{result}} is NOT an object (Key-Value) but a string of an ordered list.
  • When processing this in an AI node, specify "This is a JSON list string" or instruct to reference data by order.

πŸ’‘ Usage Example 1: Form Response Notification

[Google Sheets Form] β†’ [ChatGPT] β†’ [Slack]
  1. Receive form submission
  2. ChatGPT parses data and writes message
  3. Send to Slack

ChatGPT Prompt Example:

Here is Google Form response data (JSON list string):
{{result}}

The data order is [timestamp, name, email, content].

Please organize this data nicely and write a Slack notification message.

πŸ’‘ Usage Example 2: Data Classification

[Google Sheets Form] β†’ [ChatGPT] β†’ [INBLOG]
  1. Receive form data
  2. AI analyzes content and drafts blog post
  3. Save as draft in INBLOG

🎯 Pro Tips

Check Data Order

  • The column order in Google Sheets matches the value order in the `` list.
  • If you change the sheet column order, the incoming data order also changes.

πŸ†š Text Input vs Click Differences

Item Text Input Click
Input Param βœ… ?q={text} required ❌ No params
Endpoint .../{ID}?q={text} .../{ID}
Purpose Get user input Simple execution trigger
Example Chatbot, Search, Translation News Summary, Data Collection

πŸ†š Which Trigger to Choose?

Situation Recommended Trigger Reason
Web Chatbot Text Input Needs user input
Telegram Bot Telegram Webhook Auto-process channel posts
Manual Run Click Immediate run without params
Daily Report Click Auto-generate without input
Form Process Google Sheets Form Auto-run on form submission

🎯 Next Steps


❓ FAQ

Q: Can I use multiple Trigger nodes? A: A workflow can only have one Trigger.

Q: Telegram Webhook isn't working A: Check if the bot is registered as an Administrator of the channel. (It may not work in private chats/groups)

Q: Where can I check the Text Input node URL? A: You can check it in the "API Info" tab after deploying the workflow.

results matching ""

    No results matching ""