Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

Drop the custom-cron schedule option from automations

Paulo Castellano37a7a64ff092
diff --git a/app/Http/Requests/App/Automations/UpdateAutomationRequest.php b/app/Http/Requests/App/Automations/UpdateAutomationRequest.php
index 2257fd242..8725bcbc2 100644
--- a/app/Http/Requests/App/Automations/UpdateAutomationRequest.php
+++ b/app/Http/Requests/App/Automations/UpdateAutomationRequest.php
@@ -121,7 +121,7 @@ class UpdateAutomationRequest extends FormRequest
NodeType::Trigger->value => [
'trigger_type' => ['required', Rule::in(array_column(TriggerType::cases(), 'value'))],
'cron' => ['required_if:nodes.*.data.trigger_type,'.TriggerType::Schedule->value, 'string'],
- 'schedule_field' => ['sometimes', Rule::in(['minutes', 'hours', 'days', 'weeks', 'months', 'custom'])],
+ 'schedule_field' => ['sometimes', Rule::in(['minutes', 'hours', 'days', 'weeks', 'months'])],
'schedule_minutes_interval' => ['sometimes', 'integer', 'min:1', 'max:59'],
'schedule_hours_interval' => ['sometimes', 'integer', 'min:1', 'max:23'],
'schedule_days_interval' => ['sometimes', 'integer', 'min:1', 'max:31'],
@@ -130,7 +130,6 @@ class UpdateAutomationRequest extends FormRequest
'schedule_weekdays' => ['sometimes', 'array'],
'schedule_weekdays.*' => ['integer', 'min:0', 'max:6'],
'schedule_day_of_month' => ['sometimes', 'integer', 'min:1', 'max:31'],
- 'schedule_custom_cron' => ['sometimes', 'nullable', 'string'],
'schedule_timezone' => ['sometimes', 'string', 'timezone'],
],
NodeType::FetchRss->value => [
diff --git a/lang/en/automations.php b/lang/en/automations.php
index c8340e44a..eb6e90788 100644
--- a/lang/en/automations.php
+++ b/lang/en/automations.php
@@ -241,7 +241,6 @@ return [
'days' => 'Days',
'weeks' => 'Weeks',
'months' => 'Months',
- 'custom' => 'Custom (Cron)',
],
'minutes_interval' => 'Minutes between triggers',
'hours_interval' => 'Hours between triggers',
@@ -250,8 +249,6 @@ return [
'minute' => 'Trigger at minute',
'weekdays' => 'Trigger on weekdays',
'day_of_month' => 'Day of month',
- 'custom_cron' => 'Cron expression',
- 'custom_cron_hint' => 'Format: minute hour day month weekday',
'timezone_hint' => 'All times in :tz',
'weekday_names' => [
'sun' => 'Sun',
diff --git a/lang/es/automations.php b/lang/es/automations.php
index fa683cb56..9b43c1e46 100644
--- a/lang/es/automations.php
+++ b/lang/es/automations.php
@@ -241,7 +241,6 @@ return [
'days' => 'Días',
'weeks' => 'Semanas',
'months' => 'Meses',
- 'custom' => 'Personalizado (Cron)',
],
'minutes_interval' => 'Minutos entre disparos',
'hours_interval' => 'Horas entre disparos',
@@ -250,8 +249,6 @@ return [
'minute' => 'Disparar al minuto',
'weekdays' => 'Disparar en días',
'day_of_month' => 'Día del mes',
- 'custom_cron' => 'Expresión cron',
- 'custom_cron_hint' => 'Formato: minuto hora día mes día-de-semana',
'timezone_hint' => 'Todos los horarios en :tz',
'weekday_names' => [
'sun' => 'Dom',
diff --git a/lang/pt-BR/automations.php b/lang/pt-BR/automations.php
index fb0e9fd7e..0d9361c16 100644
--- a/lang/pt-BR/automations.php
+++ b/lang/pt-BR/automations.php
@@ -241,7 +241,6 @@ return [
'days' => 'Dias',
'weeks' => 'Semanas',
'months' => 'Meses',
- 'custom' => 'Personalizado (Cron)',
],
'minutes_interval' => 'Minutos entre disparos',
'hours_interval' => 'Horas entre disparos',
@@ -250,8 +249,6 @@ return [
'minute' => 'Disparar no minuto',
'weekdays' => 'Disparar nos dias',
'day_of_month' => 'Dia do mês',
- 'custom_cron' => 'Expressão cron',
- 'custom_cron_hint' => 'Formato: minuto hora dia mês dia-da-semana',
'timezone_hint' => 'Todos os horários em :tz',
'weekday_names' => [
'sun' => 'Dom',
diff --git a/resources/js/components/automations/config/TriggerNodeConfig.vue b/resources/js/components/automations/config/TriggerNodeConfig.vue
index 2a30d1832..fb87cbe89 100644
--- a/resources/js/components/automations/config/TriggerNodeConfig.vue
+++ b/resources/js/components/automations/config/TriggerNodeConfig.vue
@@ -1,6 +1,13 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
+import {
+ generateScheduleCron,
+ humanSchedule as scheduleSummary,
+ normalizeScheduleData,
+ timezoneAbbr as getTimezoneAbbr,
+ userTimezone as getUserTimezone,
+} from '@/components/automations/schedule-summary';
import InputError from '@/components/InputError.vue';
import { Input } from '@/components/ui/input';
import {
@@ -10,15 +17,8 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
-import {
- generateScheduleCron,
- humanSchedule as scheduleSummary,
- normalizeScheduleData,
- timezoneAbbr as getTimezoneAbbr,
- userTimezone as getUserTimezone,
-} from '@/components/automations/schedule-summary';
-import { ScheduleField } from '@/types/automation/schedule-field';
import type { ScheduleData } from '@/types/automation/schedule-data';
+import { ScheduleField } from '@/types/automation/schedule-field';
import { TriggerType, type TriggerTypeValue } from '@/types/automation/trigger-type';
const props = defineProps<{
@@ -132,7 +132,6 @@ watch(local, (val) => emit('update', val), { deep: true });
<SelectItem :value="ScheduleField.Days">{{ $t('automations.config.trigger.schedule.fields.days') }}</SelectItem>
<SelectItem :value="ScheduleField.Weeks">{{ $t('automations.config.trigger.schedule.fields.weeks') }}</SelectItem>
<SelectItem :value="ScheduleField.Months">{{ $t('automations.config.trigger.schedule.fields.months') }}</SelectItem>
- <SelectItem :value="ScheduleField.Custom">{{ $t('automations.config.trigger.schedule.fields.custom') }}</SelectItem>
</SelectContent>
</Select>
</div>
@@ -266,17 +265,8 @@ watch(local, (val) => emit('update', val), { deep: true });
</div>
</template>
- <template v-if="local.schedule_field === ScheduleField.Custom">
- <div>
- <label class="mb-1 block text-sm font-medium">{{ $t('automations.config.trigger.schedule.custom_cron') }}</label>
- <Input v-model="local.schedule_custom_cron" placeholder="0 9 * * 1,3,5" />
- <InputError :message="errors?.cron" class="mt-1" />
- <p class="mt-1 text-xs text-foreground/50">{{ $t('automations.config.trigger.schedule.custom_cron_hint') }}</p>
- </div>
- </template>
-
<p class="rounded-md bg-muted px-3 py-2 text-xs text-foreground/70">{{ humanSchedule }}</p>
- <p v-if="local.schedule_field !== ScheduleField.Custom" class="text-xs text-foreground/50">{{ $t('automations.config.trigger.schedule.timezone_hint', { tz: timezoneAbbr }) }}</p>
+ <p class="text-xs text-foreground/50">{{ $t('automations.config.trigger.schedule.timezone_hint', { tz: timezoneAbbr }) }}</p>
</template>
</div>
</template>
diff --git a/resources/js/components/automations/schedule-summary.ts b/resources/js/components/automations/schedule-summary.ts
index 9af2a40ff..2d75dd4e8 100644
--- a/resources/js/components/automations/schedule-summary.ts
+++ b/resources/js/components/automations/schedule-summary.ts
@@ -1,8 +1,8 @@
import { trans, transChoice } from 'laravel-vue-i18n';
import dayjs from '@/dayjs';
-import { ScheduleField } from '@/types/automation/schedule-field';
import type { ScheduleData } from '@/types/automation/schedule-data';
+import { ScheduleField } from '@/types/automation/schedule-field';
import { TriggerType } from '@/types/automation/trigger-type';
const pad2 = (n: number) => String(n).padStart(2, '0');
@@ -81,7 +81,6 @@ export const normalizeScheduleData = (data: ScheduleData): ScheduleData => {
schedule_minute: data.schedule_minute ?? inferred.schedule_minute ?? 0,
schedule_weekdays: data.schedule_weekdays ?? inferred.schedule_weekdays ?? [1],
schedule_day_of_month: data.schedule_day_of_month ?? inferred.schedule_day_of_month ?? 1,
- schedule_custom_cron: data.schedule_custom_cron ?? '0 9 * * 1,3,5',
};
};
@@ -110,8 +109,6 @@ export const generateScheduleCron = (data: ScheduleData): string => {
const d = num(data, 'schedule_day_of_month', 1, 1, 31);
return `${minute} ${hour} ${d} * *`;
}
- case ScheduleField.Custom:
- return (data.schedule_custom_cron ?? '').trim() || '0 9 * * *';
}
return '0 9 * * *';
};
@@ -143,8 +140,6 @@ export const humanSchedule = (data: ScheduleData): string => {
const d = num(data, 'schedule_day_of_month', 1, 1, 31);
return trans(summaryKey('monthly'), { day: String(d), time });
}
- case ScheduleField.Custom:
- return (data.schedule_custom_cron ?? '').trim() || '0 9 * * *';
}
return '';
};
diff --git a/resources/js/types/automation/schedule-data.ts b/resources/js/types/automation/schedule-data.ts
index b83eecf8c..eed3e1538 100644
--- a/resources/js/types/automation/schedule-data.ts
+++ b/resources/js/types/automation/schedule-data.ts
@@ -23,6 +23,5 @@ export interface ScheduleData {
schedule_minute?: number;
schedule_weekdays?: number[];
schedule_day_of_month?: number;
- schedule_custom_cron?: string;
schedule_timezone?: string;
}
diff --git a/resources/js/types/automation/schedule-field.ts b/resources/js/types/automation/schedule-field.ts
index b85ff5d53..fa7b88c10 100644
--- a/resources/js/types/automation/schedule-field.ts
+++ b/resources/js/types/automation/schedule-field.ts
@@ -4,7 +4,6 @@ export const ScheduleField = {
Days: 'days',
Weeks: 'weeks',
Months: 'months',
- Custom: 'custom',
} as const;
export type ScheduleFieldValue = (typeof ScheduleField)[keyof typeof ScheduleField];
diff --git a/tests/Feature/Automation/AutomationCrudTest.php b/tests/Feature/Automation/AutomationCrudTest.php
index 43d24ea1f..d8ad116dc 100644
--- a/tests/Feature/Automation/AutomationCrudTest.php
+++ b/tests/Feature/Automation/AutomationCrudTest.php
@@ -87,7 +87,6 @@ it('persists every trigger schedule editor field through a save round-trip', fun
'daily at time' => [['schedule_field' => 'days', 'schedule_days_interval' => 2, 'schedule_hour' => 8, 'schedule_minute' => 45]],
'weekly on weekdays' => [['schedule_field' => 'weeks', 'schedule_weekdays' => [1, 3, 5], 'schedule_hour' => 14, 'schedule_minute' => 0]],
'monthly on day-of-month' => [['schedule_field' => 'months', 'schedule_day_of_month' => 15, 'schedule_hour' => 9, 'schedule_minute' => 0]],
- 'custom cron' => [['schedule_field' => 'custom', 'schedule_custom_cron' => '0 9 * * 1,3,5']],
'timezone' => [['schedule_timezone' => 'America/Sao_Paulo']],
'all fields together' => [[
'schedule_field' => 'weeks',
@@ -98,7 +97,6 @@ it('persists every trigger schedule editor field through a save round-trip', fun
'schedule_minute' => 30,
'schedule_weekdays' => [0, 6],
'schedule_day_of_month' => 28,
- 'schedule_custom_cron' => '*/5 * * * *',
'schedule_timezone' => 'Europe/Lisbon',
]],
]);