Overview
The TP Service (Tareas Programadas) manages scheduled tasks and background jobs for the HERCULES SGI platform. It handles recurring operations such as email notifications, data synchronization, and periodic calculations.Base URL:
Service Path:
http://localhost:4283 (development)Service Path:
/sgitask, /configAuthentication
All endpoints require a valid OAuth2 access token with administrative permissions.SGI Task Endpoints
The TP service exposes APIs for managing and monitoring scheduled tasks.List Tasks
Retrieve all registered scheduled tasks.- Administrative access to task management
Get Task by ID
Retrieve details of a specific scheduled task.Task identifier
Enable/Disable Task
Enable or disable a scheduled task.Task identifier
Whether to enable (true) or disable (false) the task
Trigger Task Manually
Manually trigger a task execution outside its regular schedule.Task identifier
Task Model
Unique task identifier
Human-readable task name
Task description
Cron expression defining the schedule (e.g.,
0 */5 * * * * for every 5 minutes)Whether the task is currently enabled
ISO 8601 timestamp of last execution
ISO 8601 timestamp of next scheduled execution
Current status:
RUNNING, COMPLETED, FAILED, DISABLEDTotal number of times the task has been executed
Duration of last execution in milliseconds
Average execution duration in milliseconds
Built-in Scheduled Tasks
The TP service includes several pre-configured tasks:Email Notifications Processor
ID:email-notificationsSchedule: Every 5 minutes
Purpose: Processes pending emails from the COM service queue and sends them via SMTP
Scientific Production Sync
ID:production-syncSchedule: Daily at 2:00 AM
Purpose: Synchronizes scientific production data from CVN (Currículum Vitae Normalizado)
Project Budget Calculations
ID:budget-calculationsSchedule: Daily at 3:00 AM
Purpose: Recalculates project budgets, amortizations, and financial summaries
Ethics Review Reminders
ID:ethics-remindersSchedule: Daily at 9:00 AM
Purpose: Sends reminder notifications for pending ethics reviews and upcoming deadlines
Report Cache Cleanup
ID:report-cache-cleanupSchedule: Weekly on Sundays at 1:00 AM
Purpose: Cleans up old cached reports and temporary files
Cron Expression Examples
| Expression | Description |
|---|---|
0 */5 * * * * | Every 5 minutes |
0 0 * * * * | Every hour at minute 0 |
0 0 2 * * * | Daily at 2:00 AM |
0 0 9 * * MON-FRI | Weekdays at 9:00 AM |
0 0 1 * * SUN | Sundays at 1:00 AM |
0 30 8 1 * * | First day of each month at 8:30 AM |
Configuration Endpoint
The TP service includes a configuration endpoint for managing task-specific settings.Task Monitoring
Monitor task execution history and performance metrics to ensure smooth operation.Check Task Health
Verify that critical tasks are running successfully:Error Responses
HTTP status code
Error type
Human-readable error message
Best Practices
Related Documentation
COM Service
Email and communications processed by scheduled tasks
Administrator Guide
System administration and monitoring