@@ -111,44 +111,16 @@ const isActionType = (
111111const getCommonFields = ( node : WorkflowNode ) => {
112112 const actionType = node . data . config ?. actionType as string | undefined ;
113113
114- // First, check if the plugin defines output fields
115- if ( actionType ) {
116- const action = findActionById ( actionType ) ;
117- if ( action ?. outputFields && action . outputFields . length > 0 ) {
118- return action . outputFields ;
119- }
120- }
121-
122- // Legacy hardcoded fields for backwards compatibility
123- if ( isActionType ( actionType , "Find Issues" , "linear/find-issues" ) ) {
124- return [
125- { field : "issues" , description : "Array of issues found" } ,
126- { field : "count" , description : "Number of issues" } ,
127- ] ;
128- }
129- if ( isActionType ( actionType , "Send Email" , "resend/send-email" ) ) {
130- return [
131- { field : "id" , description : "Email ID" } ,
132- { field : "status" , description : "Send status" } ,
133- ] ;
134- }
135- if ( isActionType ( actionType , "Create Ticket" , "linear/create-ticket" ) ) {
136- return [
137- { field : "id" , description : "Ticket ID" } ,
138- { field : "url" , description : "Ticket URL" } ,
139- { field : "number" , description : "Ticket number" } ,
140- ] ;
141- }
114+ // Special handling for dynamic outputs (system actions and schema-based)
142115 if ( actionType === "HTTP Request" ) {
143116 return [
144117 { field : "data" , description : "Response data" } ,
145118 { field : "status" , description : "HTTP status code" } ,
146119 ] ;
147120 }
121+
148122 if ( actionType === "Database Query" ) {
149123 const dbSchema = node . data . config ?. dbSchema as string | undefined ;
150-
151- // If schema is defined, show schema fields
152124 if ( dbSchema ) {
153125 try {
154126 const schema = JSON . parse ( dbSchema ) as SchemaField [ ] ;
@@ -159,18 +131,17 @@ const getCommonFields = (node: WorkflowNode) => {
159131 // If schema parsing fails, fall through to default fields
160132 }
161133 }
162-
163- // Default fields when no schema
164134 return [
165135 { field : "rows" , description : "Query result rows" } ,
166136 { field : "count" , description : "Number of rows" } ,
167137 ] ;
168138 }
139+
140+ // AI Gateway generate-text has dynamic output based on format/schema
169141 if ( isActionType ( actionType , "Generate Text" , "ai-gateway/generate-text" ) ) {
170142 const aiFormat = node . data . config ?. aiFormat as string | undefined ;
171143 const aiSchema = node . data . config ?. aiSchema as string | undefined ;
172144
173- // If format is object and schema is defined, show schema fields under "object" prefix
174145 if ( aiFormat === "object" && aiSchema ) {
175146 try {
176147 const schema = JSON . parse ( aiSchema ) as SchemaField [ ] ;
@@ -181,59 +152,22 @@ const getCommonFields = (node: WorkflowNode) => {
181152 // If schema parsing fails, fall through to default fields
182153 }
183154 }
184-
185- // Default fields for text format or when no schema
186- return [
187- { field : "text" , description : "Generated text" } ,
188- { field : "model" , description : "Model used" } ,
189- ] ;
155+ return [ { field : "text" , description : "Generated text" } ] ;
190156 }
191- if ( isActionType ( actionType , "Generate Image" , "ai-gateway/generate-image" ) ) {
192- return [
193- { field : "base64" , description : "Base64 image data" } ,
194- { field : "model" , description : "Model used" } ,
195- ] ;
196- }
197- if (
198- isActionType ( actionType , "Scrape" , "Scrape URL" , "firecrawl/scrape" )
199- ) {
200- return [
201- { field : "markdown" , description : "Scraped content as markdown" } ,
202- { field : "metadata.url" , description : "Page URL" } ,
203- { field : "metadata.title" , description : "Page title" } ,
204- { field : "metadata.description" , description : "Page description" } ,
205- { field : "metadata.language" , description : "Page language" } ,
206- { field : "metadata.favicon" , description : "Favicon URL" } ,
207- ] ;
208- }
209- if ( isActionType ( actionType , "Search" , "Search Web" , "firecrawl/search" ) ) {
210- return [ { field : "web" , description : "Array of search results" } ] ;
211- }
212- if ( isActionType ( actionType , "Create Chat" , "v0/create-chat" ) ) {
213- return [
214- { field : "chatId" , description : "v0 chat ID" } ,
215- { field : "url" , description : "v0 chat URL" } ,
216- { field : "demoUrl" , description : "Demo preview URL" } ,
217- ] ;
218- }
219- if ( isActionType ( actionType , "Send Message" , "v0/send-message" ) ) {
220- return [
221- { field : "chatId" , description : "v0 chat ID" } ,
222- { field : "demoUrl" , description : "Demo preview URL" } ,
223- ] ;
224- }
225- if ( isActionType ( actionType , "Send Slack Message" , "slack/send-message" ) ) {
226- return [
227- { field : "ok" , description : "Success status" } ,
228- { field : "ts" , description : "Message timestamp" } ,
229- { field : "channel" , description : "Channel ID" } ,
230- ] ;
157+
158+ // Check if the plugin defines output fields
159+ if ( actionType ) {
160+ const action = findActionById ( actionType ) ;
161+ if ( action ?. outputFields && action . outputFields . length > 0 ) {
162+ return action . outputFields ;
163+ }
231164 }
165+
166+ // Trigger fields
232167 if ( node . data . type === "trigger" ) {
233168 const triggerType = node . data . config ?. triggerType as string | undefined ;
234169 const webhookSchema = node . data . config ?. webhookSchema as string | undefined ;
235170
236- // If it's a webhook trigger with a schema, show schema fields
237171 if ( triggerType === "Webhook" && webhookSchema ) {
238172 try {
239173 const schema = JSON . parse ( webhookSchema ) as SchemaField [ ] ;
@@ -245,7 +179,6 @@ const getCommonFields = (node: WorkflowNode) => {
245179 }
246180 }
247181
248- // Default trigger fields
249182 return [
250183 { field : "triggered" , description : "Trigger status" } ,
251184 { field : "timestamp" , description : "Trigger timestamp" } ,
0 commit comments