import deepline from 'deepline'; type Account = { record_id: string; }; export const config = { description: 'Refresh Attio account records on the scheduled cadence.', cron: { schedule: '0 9 * * *', timezone: 'America/New_York', input: { accounts: [], refreshExisting: true }, }, billing: { maxCreditsPerRun: 25 }, }; export default async function ({ accounts, }: { accounts: Account[]; refreshExisting?: boolean; }) { const rows = await deepline .dataset('account_refresh', accounts) .withColumn('company_record', (account) => deepline.tools.execute({ id: 'company_record', tool: 'attio_get_record', input: { object: 'companies', record_id: account.record_id }, description: 'Read the Attio company record for this account.', staleAfterSeconds: 86_400, }), ) .run({ key: 'record_id', description: 'Read Attio company records, reusing results for one day.', }); return { rows }; }