@@ -85,17 +85,24 @@ const coreOutputs = {
8585 type : 'string' ,
8686 description : 'Lemlist team identifier' ,
8787 } ,
88+ } as const
89+
90+ /**
91+ * Campaign-related fields - only present when activity is part of a campaign
92+ * These may be missing for first replies or activities outside campaign context
93+ */
94+ const campaignOutputs = {
8895 leadId : {
8996 type : 'string' ,
90- description : 'Lead identifier' ,
97+ description : 'Lead identifier (only present for campaign activities) ' ,
9198 } ,
9299 campaignId : {
93100 type : 'string' ,
94- description : 'Campaign identifier' ,
101+ description : 'Campaign identifier (only present for campaign activities) ' ,
95102 } ,
96103 campaignName : {
97104 type : 'string' ,
98- description : 'Campaign name' ,
105+ description : 'Campaign name (only present for campaign activities) ' ,
99106 } ,
100107} as const
101108
@@ -193,6 +200,7 @@ const emailContentOutputs = {
193200export function buildEmailSentOutputs ( ) : Record < string , TriggerOutput > {
194201 return {
195202 ...coreOutputs ,
203+ ...campaignOutputs ,
196204 ...leadOutputs ,
197205 ...sequenceOutputs ,
198206 ...senderOutputs ,
@@ -206,6 +214,7 @@ export function buildEmailSentOutputs(): Record<string, TriggerOutput> {
206214export function buildEmailRepliedOutputs ( ) : Record < string , TriggerOutput > {
207215 return {
208216 ...coreOutputs ,
217+ ...campaignOutputs ,
209218 ...leadOutputs ,
210219 ...sequenceOutputs ,
211220 ...senderOutputs ,
@@ -219,6 +228,7 @@ export function buildEmailRepliedOutputs(): Record<string, TriggerOutput> {
219228export function buildEmailOpenedOutputs ( ) : Record < string , TriggerOutput > {
220229 return {
221230 ...coreOutputs ,
231+ ...campaignOutputs ,
222232 ...leadOutputs ,
223233 ...sequenceOutputs ,
224234 ...senderOutputs ,
@@ -235,6 +245,7 @@ export function buildEmailOpenedOutputs(): Record<string, TriggerOutput> {
235245export function buildEmailClickedOutputs ( ) : Record < string , TriggerOutput > {
236246 return {
237247 ...coreOutputs ,
248+ ...campaignOutputs ,
238249 ...leadOutputs ,
239250 ...sequenceOutputs ,
240251 ...senderOutputs ,
@@ -255,6 +266,7 @@ export function buildEmailClickedOutputs(): Record<string, TriggerOutput> {
255266export function buildEmailBouncedOutputs ( ) : Record < string , TriggerOutput > {
256267 return {
257268 ...coreOutputs ,
269+ ...campaignOutputs ,
258270 ...leadOutputs ,
259271 ...sequenceOutputs ,
260272 ...senderOutputs ,
@@ -275,6 +287,7 @@ export function buildEmailBouncedOutputs(): Record<string, TriggerOutput> {
275287export function buildLinkedInRepliedOutputs ( ) : Record < string , TriggerOutput > {
276288 return {
277289 ...coreOutputs ,
290+ ...campaignOutputs ,
278291 ...leadOutputs ,
279292 ...sequenceOutputs ,
280293 text : {
@@ -290,6 +303,7 @@ export function buildLinkedInRepliedOutputs(): Record<string, TriggerOutput> {
290303export function buildInterestOutputs ( ) : Record < string , TriggerOutput > {
291304 return {
292305 ...coreOutputs ,
306+ ...campaignOutputs ,
293307 ...leadOutputs ,
294308 ...sequenceOutputs ,
295309 } as Record < string , TriggerOutput >
@@ -302,6 +316,7 @@ export function buildInterestOutputs(): Record<string, TriggerOutput> {
302316export function buildLemlistOutputs ( ) : Record < string , TriggerOutput > {
303317 return {
304318 ...coreOutputs ,
319+ ...campaignOutputs ,
305320 ...leadOutputs ,
306321 ...sequenceOutputs ,
307322 ...senderOutputs ,
0 commit comments