btp-job-scheduling
Skill1 starsChanged 4 months agoMITView on GitHub
SAP BTP Job Scheduling service — cron-based job definitions, REST API, job execution monitoring, retry policies, job logs, ABAP Cloud application jobs. Use when scheduling recurring BTP tasks, creating cron jobs, or monitoring job executions.
- Reads credentials
- Sends data out
In this repository413 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- .cursor/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sap-router-skillCopilot instructions
- .cursor/rules/sap-router.mdcCursor rule
- abap-cloud-migrationSkill
- abap-cloudSkill
- abap-code-patternsSkill
- abap-code-reviewSkill
- abap-docs-referenceSkill
- abapgitSkill
- abapSkill
- abap-snippetSkill
- abap-sql-amdpSkill
- abap-system-infoSkill
- abap-unit-testingSkill
- arc-1-skillsSkill
- atc-cloudificationSkill
- authorization-iamSkill
- automation-pilot-catalog-explorerSkill
- automation-pilot-command-generationSkill
- automation-pilot-command-reviewSkill
- automation-pilot-content-management-via-apiSkill
- automation-pilot-debuggerSkill
- automation-pilot-executions-apiSkill
- automation-pilot-executor-executescriptSkill
- automation-pilot-executor-httprequestSkill
- automation-pilot-mcp-server-generationSkill
- automation-pilot-scheduled-executions-apiSkill
- badi-enhancementSkill
- btp-abap-environmentSkill
- btp-best-practicesSkill
- btp-build-work-zoneSkill
- btp-business-application-studioSkill
- btp-ciasSkill
- btp-cloud-foundrySkill
- btp-cloud-identitySkill
- btp-cloud-loggingSkill
- btp-cloud-platformSkill
- btp-cloud-transport-managementSkill
- btp-connectivitySkill
- btp-developer-guideSkill
- btp-diagram-generatorSkill
- btp-integration-suiteSkill
- btp-master-data-integrationSkill
- btp-service-managerSkill
- cap-add-remote-serviceSkill
- cap-developerSkill
- cap-triviaSkill
- capture-answerSkill
- cap-upgradeSkill
- cds-view-entitiesSkill
- claude-abap-skillsSkill
- claude-memSkill
- clean-abapSkill
- context-modeSkill
- cpi-iflow-developmentSkill
- engine-cap-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Create a JSON file job.json:
- Distinctive: line 146
Create Application Job Template via ADT → New → ABAP Application Job Template
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SAP BTP Job Scheduling Service
Cron-based job scheduler on SAP BTP — schedule REST endpoints with retry, monitoring, and logging.
Prerequisites
- SAP BTP subaccount with Job Scheduling service entitlement
- Service instance created and bound to your application
- Target REST endpoint accessible from BTP (Cloud Foundry app or external URL)
- XSUAA service for authentication token generation
- For ABAP Cloud: ADT (ABAP Development Tools) and
IF_APJ_DT_EXECUTION_OBJECTinterface
Cron Reference
| Expression | Trigger |
0 6 * * * | Every day at 06:00 UTC |
*/15 * * * * | Every 15 minutes |
0 0 1 * * | First day of month at 00:00 |
0 8 * * 1-5 | Weekdays at 08:00 UTC |
0 */2 * * * | Every 2 hours |
Steps
1. Create a Job Definition
Create a JSON file job.json:
{
"job": {
"name": "daily-sync",
"description": "Sync orders from S/4HANA to BTP",
"active": true,
"httpMethod": "POST",
"url": "https://my-app.cfapps.us10.hana.ondemand.com/sync",
"noOverlap": true,
"retryPolicy": {
"maxRetries": 3,
"retryInterval": 300,
"retryStrategy": "fixed"
},
"schedules": [
{
"cron": "0 6 * * *",
"description": "Every day at 06:00 UTC",
"timezone": "UTC"
}
]
}
}2. Register the Job via REST API
# Get service credentials from BTP
cf service-key job-scheduler-dev job-scheduler-key
# Extract scheduler URL and credentials, then create job
curl -X POST "https://$SCHEDULER_URL/scheduler/jobs" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d @job.json | jq .
# Verify job was created
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync" \
-H "Authorization: Bearer $ACCESS_TOKEN" | jq .3. Trigger a Manual Run
# Start job immediately (bypass schedule)
curl -X POST "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/schedules" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "immediate"}' | jq .
# Check execution runs
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/runs" \
-H "Authorization: Bearer $ACCESS_TOKEN" | jq '.runs[] | {status, startTime, endTime}'4. Monitor Job Executions
# List recent runs with status
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/runs?\$top=10" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
| jq '.runs[] | {id, status, start: .startTime, end: .endTime, exitCode}'
# Get detailed logs for a specific run
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/runs/$RUN_ID/logs" \
-H "Authorization: Bearer $ACCESS_TOKEN" | jq '.logs[]'5. Update or Delete a Job
# Update schedule (e.g., change to every 30 min)
curl -X PUT "https://$SCHEDULER_URL/scheduler/jobs/daily-sync" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"schedules": [{"cron": "*/30 * * * *", "description": "Every 30 min"}]}'
# Deactivate without deleting
curl -X PATCH "https://$SCHEDULER_URL/scheduler/jobs/daily-sync" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"active": false}'
# Delete job entirely
curl -X DELETE "https://$SCHEDULER_URL/scheduler/jobs/daily-sync" \
-H "Authorization: Bearer $ACCESS_TOKEN"6. Create ABAP Cloud Application Job (Replaces SM37)
- In ADT, create a class implementing
IF_APJ_DT_EXECUTION_OBJECT - Define job template in the class via
IF_APJ_DT_EXECUTION_OBJECT~get_parameters - Register template:
" Class implementing the job step handler
CLASS zcl_daily_sync_job DEFINITION
PUBLIC
INTERFACES if_apj_dt_execution_object
INTERFACES if_apj_rt_execution_object.
ENDCLASS.- Create Application Job Template via ADT → New → ABAP Application Job Template
- Schedule via Fiori app Application Jobs (transaction
F1076)
Pitfalls
| Cause | Solution |
| Job fails with HTTP 401 Unauthorized | Token expired before job runs. Use OAuth client credentials flow in the job definition or configure Authorization header dynamically via a destination with OAuth2ClientCredentials. |
| Job runs but target endpoint unreachable | Ensure the Cloud Foundry app is running and the URL is correct. Check cf apps for status. The scheduler and app must be in the same subaccount or use an internet-facing route. |
| Concurrent runs corrupt data | Missing noOverlap: true. Set it to true in the job definition to prevent overlapping executions. |
| Job exceeds 2h timeout | Max execution time is 2 hours. Split long-running jobs into smaller batches or implement pagination in the REST endpoint. Use retryPolicy for transient failures. |
| Cron fires at wrong time | Cron expressions use UTC only — no timezone offset. Calculate the UTC equivalent of your local time. Add "timezone": "UTC" explicitly for clarity. |
| Lite plan rejects job creation | Lite plan is limited to 10 active jobs. Deactivate or delete unused jobs, or upgrade to standard plan. |
| Retry storms after backend outage | retryInterval too short. Increase to 300+ seconds and set maxRetries to 3-5. Consider exponential backoff if supported. |
Verification
# Job exists and is active
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
| jq '{name, active, schedules: .schedules[0].cron}'
# Last run succeeded
LAST_RUN=$(curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/runs?\$top=1" \
-H "Authorization: Bearer $ACCESS_TOKEN" | jq -r '.runs[0].status')
echo "Last run status: $LAST_RUN" # Should be "COMPLETED" or "SUCCESSFUL"
# Check run count today
curl -s "https://$SCHEDULER_URL/scheduler/jobs/daily-sync/runs?\$top=50" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
| jq '[.runs[] | select(.startTime | startswith("2024-01-15"))] | length'
# ABAP job template registered
# In ADT: Search "zcl_daily_sync_job" → verify IF_APJ_DT_EXECUTION_OBJECT is implemented
# In Fiori: F1076 → filter by template name → should appear in listChecklist:
- Job definition returns HTTP 201 on creation
- Manual immediate run completes with status
COMPLETED - Scheduled runs execute at the expected UTC time
noOverlap: trueprevents concurrent executions- Retry policy triggers on failure (check run logs for retry attempts)
- ABAP application job template visible in Fiori app F1076
- No more than 10 active jobs on Lite plan
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

