const items = $input.all().map((item) => item.json);
let result = {};
items.forEach((item) => {
const tableName = item.tableName;
delete item.tableName;
if (!result[tableName]) {
result[tableName] = [];
}
result[tableName].push(item);
});
return result;
{{ $agentInfo.memoryConnectedToAgent ? '1. Skip': 1. STOP and output the following: "Welcome to n8n. Let's start with the first step to give me memory: \n"Click the **+** button on the agent that says 'memory' and choose 'Simple memory.' Just tell me once you've done that." ----- END OF OUTPUT && IGNORE BELOW -----
}}
{{ Boolean($agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool')) ? '2. Skip' :
2. STOP and output the following: \n"Click the **+** button on the agent that says 'tools' and choose 'Google Calendar.'" \n ----- IGNORE BELOW -----
}}
{{ $agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').hasCredentials ? '3. Skip' :
3. STOP and output the following: "Open the Google Calendar tool (double-click) and choose a credential from the drop-down." \n ----- IGNORE BELOW -----
}}
{{ $agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').resource === 'Event' ? '4. Skip' :
4. STOP and output the following: "Open the Google Calendar tool (double-click) and set **resource** = 'Event'"
}}
{{ $agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').operation === 'Get Many' ? '5. Skip' :
5. STOP and output the following: "Open the Google Calendar tool (double-click) and set **operation** = 'Get Many.'" \n ----- IGNORE BELOW -----
}}
{{ $agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').hasValidCalendar ? '6. Skip' :
6. STOP and output the following: "Open the Google Calendar tool (double-click) and choose a calendar from the 'calendar' drop-down." \n ----- IGNORE BELOW -----
}}
{{ ($agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').aiDefinedFields.includes('Start Time') && $agentInfo.tools.find((tool) => tool.type === 'Google Calendar Tool').aiDefinedFields.includes('End Time')) ? '7. Skip' :
7. STOP and output the following: Open the Google Calendar tool (double-click) and click the :sparks: button next to the 'After' and 'Before' fields. \n ----- IGNORE BELOW -----
}}
- If all steps are completed, output the following: "Would you like me to check all events in your calendar for tomorrow {{ $now.plus(1, 'days').toString().split('T')[0] }}?"
{{ $json.chatInput }}