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
Copy file name to clipboardExpand all lines: webserver/src/main/java/io/kestra/webserver/services/ai/FlowYamlBuilder.java
+3-37Lines changed: 3 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ public interface FlowYamlBuilder {
12
12
{_{flowSchema}_}
13
13
```
14
14
15
+
Before generating YAML, if {_{namespace}_} is provided, call the tool getPluginDefaults(tenantId, namespace) and use the returned plugin defaults to decide which task properties to omit. Respect `forced: true` defaults which override task values at runtime.
16
+
15
17
Additional runtime inputs available to you as variables (preferred over embedding data inside the schema):
16
18
- {_{namespace}_}: An explicit namespace string provided separately. If present, prefer this over any namespace found in the YAML snippet.
17
19
- {_{tenantId}_}: An explicit tenant identifier (may be null for single-tenant deployments). If present, prefer this over any tenantId found in the YAML snippet.
@@ -41,7 +43,7 @@ Avoid duplicating existing intent (e.g., if the Flow logs "hi" and the user want
41
43
- Triggers expose some variables that can be accessed through `trigger.outputName` in expressions. The only variables available are those defined in the trigger's outputs.
42
44
- Unless specified by the user, never assume a local port to serve any content, always use a remote URL (like a public HTTP server) to fetch content.
43
45
- Unless specified by the user, do not use any authenticated API, always use public APIs or those that don't require authentication.
44
-
- To avoid escaping quotes, use double quotes first and if you need quotes inside, use single ones. Only escape them if you have 3+ level quotes, for example: `message: "Hello {{inputs.userJson | jq('.name')}}"` is preferred but `message: "Hello \"Bob\""` may still be used.
46
+
- To avoid escaping quotes, use double quotes first and if you need quotes inside, use single ones. For example: `message: "Hello {{inputs.userJson | jq('.name')}}"` is preferred.
45
47
- A property key is unique within each type.
46
48
- When fetching data from the JDBC plugin, always use fetchType: STORE.
47
49
- Manipulating date in pebble expressions can be done through `dateAdd` (`{{now()|dateAdd(-1,'DAYS')}}`) and `date` filters (`{{"July 24, 2001"|date("yyyy-MM-dd",existingFormat="MMMM dd, yyyy")}}`). Any comparison from a number returned by `date` is a string so `| number` may be used before.
@@ -53,42 +55,6 @@ Avoid duplicating existing intent (e.g., if the Flow logs "hi" and the user want
53
55
- If you have any other information to share to the user, add them as comments in the YAML using `#` at the beginning of the raw YAML.
54
56
- Never add raw text in the response
55
57
56
-
Available Tools for Context Retrieval:
57
-
58
-
You have access to tools that retrieve namespace configuration on-demand. Prefer explicit variables `{_{namespace}_}` and `{_{tenantId}_}` when provided. Otherwise extract the namespace and tenantId from the "Current Flow YAML" section when calling these tools.
59
-
60
-
Namespace Context Tools :
61
-
62
-
1. KV Store Keys (getKvStoreKeys):
63
-
- Call when user wants to interact with KV Store (read/write/list keys)
64
-
- Returns: JSON with list of existing KV keys, descriptions, and update dates
65
-
- Usage in flows: {{kv('keyName')}} to read, KV tasks (Get, Put, Delete) to manage
66
-
67
-
2. Plugin Defaults (getPluginDefaults) [EE Only]:
68
-
- Call when user asks to integrate with specific technology (e.g., MongoDB, PostgreSQL)
69
-
- Returns: JSON mapping plugin types to their default values
0 commit comments