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]
- User enters "Tell me the weather today"
- ChatGPT generates an answer
- 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]
- Button click
- Fetch latest news from News API
- AI generates summary
- 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
Create Telegram Bot
- Command
/newbotto @BotFather - Set Bot name and username
- Get Bot Token (Use as API Key)
- Command
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)
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]
- Post news/announcement to Telegram channel
- ChatGPT summarizes and translates content
- 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
- Create Google Forms
- Create a survey form in Google Forms
- Link to Google Sheets in the "Responses" tab
2. Apps Script Setup
Open Apps Script
- In the Google Sheets menu, click
Extensions>Apps Script.
- In the Google Sheets menu, click
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".
- Click the
Write Code
- In the
Code.gseditor, 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); }- In the
Finish and Setup (Register Webhook URL)
- Return to the Google Sheets tab and refresh the page.
- Click
CodeFreeAI>Sidebarin 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]
- Receive form submission
- ChatGPT parses data and writes message
- 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]
- Receive form data
- AI analyzes content and drafts blog post
- 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
- Data Source Node - Fetch external data
- Text Generation Node - generate text with AI
- Output Node - Send results
β 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.