You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **"content"** field in the template object is the most important output - this is the **workflow publishing template string** that will be used by users. It must:
147
158
148
159
- **Be Natural and Conversational**: Sound like a helpful assistant explaining what they'll do
149
-
- **Include All Variables**: Every extracted variable must be represented with {{variable_name}} placeholders
160
+
- **Include Only Used Variables**: Only variables that are actually referenced in Canvas Nodes with {{variable_name}} format should be included
150
161
- **Maintain Original Intent**: Preserve the user's original goal and requirements
151
162
- **Be Self-Contained**: Users should understand the complete workflow from this single template
152
163
- **Use Proper Variable Format**: All placeholders must use {{variable_name}} format exactly
164
+
- **Variable Usage Validation**: If Canvas Nodes don't contain any {{variable_name}} references, the template should not include any variable placeholders
153
165
154
166
### Template String Examples:
155
167
@@ -161,6 +173,9 @@ The **"content"** field in the template object is the most important output - th
161
173
162
174
**After (User-friendly)**: "I'll create a personalized travel plan for your trip to {{destination}} from {{departure_city}} during {{dates}}. I'll arrange {{accommodation}} accommodations and {{food}} dining options, maintaining a {{pace}} pace with {{daily_routes}} for your {{goal}}."
163
175
176
+
**Example with No Variables Used**: If Canvas Nodes contain no {{variable_name}} references, the template should be:
177
+
"I'll help you create a comprehensive travel itinerary based on your preferences and requirements. I'll analyze your destination, dates, and specific needs to provide a detailed plan with accommodations, dining options, and daily activities."
178
+
164
179
${APP_PUBLISH_EXAMPLES}
165
180
166
181
## Key Learning Points from Examples
@@ -172,10 +187,12 @@ ${APP_PUBLISH_EXAMPLES}
172
187
- End with clear expectations of what will be delivered
173
188
174
189
2. **Variable Integration**:
190
+
- **CRITICAL**: Only include variables that are actually referenced in Canvas Nodes with {{variable_name}} format
175
191
- Replace specific values with descriptive placeholders
176
192
- Maintain the original semantic meaning
177
-
- Ensure all extracted variables are represented
193
+
- Ensure all used variables are represented
178
194
- Use consistent naming conventions
195
+
- **No Variables Case**: If no variables are used in Canvas Nodes, create a template without any {{variable_name}} placeholders
179
196
180
197
3. **User Experience Focus**:
181
198
- Templates should be immediately understandable
@@ -185,9 +202,44 @@ ${APP_PUBLISH_EXAMPLES}
185
202
186
203
4. **Quality Assurance**:
187
204
- Every template string must be complete and self-contained
188
-
- All variables must be properly integrated
205
+
- Only variables that are actually used in Canvas Nodes should be included
189
206
- Templates should maintain the original workflow intent
190
-
- Language should be professional yet approachable`;
207
+
- Language should be professional yet approachable
208
+
- **Variable Usage Validation**: Verify that all {{variable_name}} placeholders in the template correspond to variables actually referenced in Canvas Nodes`;
209
+
}
210
+
211
+
/**
212
+
* Analyze which variables are actually used in canvas nodes
213
+
* Returns a set of variable names that are referenced in node content
0 commit comments