sap-btp-job-scheduling
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSAP BTP Job Scheduling Service
SAP BTP Job Scheduling Service
Related Skills
相关技能
- sap-dependency-security: Use for secure dependency and workflow hardening when your job scheduling microservices maintain npm/CLI dependency stacks
- sap-dependency-security:当您的作业调度微服务维护npm/CLI依赖栈时,可使用该技能进行安全依赖与工作流加固
Table of Contents
目录
Overview
概述
SAP Job Scheduling Service is a runtime-agnostic platform service for defining and managing one-time and recurring jobs or Cloud Foundry tasks on SAP BTP. It operates across multiple hyperscalers (AWS, Azure, GCP) without requiring application modifications.
Documentation Source: https://help.sap.com/docs/job-scheduling
Last Verified: 2025-11-27
SAP Job Scheduling Service是一个与运行时无关的平台服务,用于在SAP BTP上定义和管理一次性、周期性作业或Cloud Foundry任务。它可在多个 hyperscaler(AWS、Azure、GCP)上运行,无需修改应用程序。
最后验证时间:2025-11-27
When to Use This Skill
何时使用本技能
Use this skill when:
- Setting up Job Scheduling Service on Cloud Foundry or Kyma runtime
- Creating and managing jobs via REST API or dashboard
- Configuring schedules using cron, date/time, or human-readable formats
- Implementing asynchronous job execution for long-running processes
- Securing action endpoints with OAuth 2.0 and XSUAA
- Integrating with SAP Cloud ALM or Alert Notification Service
- Developing multitenant applications with tenant-aware job scheduling
- Troubleshooting job execution issues and schedule failures
- Using the Node.js client library (@sap/jobs-client)
在以下场景中使用本技能:
- 在Cloud Foundry或Kyma运行时设置Job Scheduling Service
- 通过REST API或控制台创建和管理作业
- 使用cron、日期/时间或自然语言格式配置调度
- 为长时间运行的流程实现异步作业执行
- 使用OAuth 2.0和XSUAA保护动作端点
- 与SAP Cloud ALM或Alert Notification Service集成
- 开发具备租户感知作业调度能力的多租户应用
- 排查作业执行问题与调度失败情况
- 使用Node.js客户端库**@sap/jobs-client**
Quick Decision Tree
快速决策树
What Task?
任务类型?
Setup & Configuration
├─ Initial setup prerequisites → references/setup-guide.md
├─ Create service instance
│ ├─ BTP Cockpit → references/setup-guide.md#cockpit
│ ├─ CF CLI → references/setup-guide.md#cf-cli
│ └─ Kyma Dashboard → references/setup-guide.md#kyma
└─ Configure XSUAA scopes → references/security.md
Job Management
├─ Create jobs → references/rest-api.md#create-job
├─ Configure schedules → references/rest-api.md#schedules
├─ Run logs & monitoring → references/rest-api.md#run-logs
└─ Dashboard operations → references/operations.md#dashboard
Schedule Configuration
├─ One-time vs recurring → references/concepts.md#schedule-types
├─ Cron format → references/concepts.md#cron-format
├─ Date/time formats → references/concepts.md#date-formats
└─ Human-readable → references/concepts.md#human-readable
Asynchronous Execution
├─ Async mode flow → references/concepts.md#async-mode
├─ Callback implementation → references/rest-api.md#update-run-log
└─ CF tasks → references/concepts.md#cf-tasks
Security & Authentication
├─ OAuth 2.0 setup → references/security.md#oauth
├─ XSUAA configuration → references/security.md#xsuaa
└─ Credential rotation → references/security.md#rotation
Integrations
├─ SAP Cloud ALM → references/integrations.md#cloud-alm
└─ Alert Notification → references/integrations.md#alert-notification
Troubleshooting
├─ Common errors → references/troubleshooting.md#errors
├─ FAQ → references/troubleshooting.md#faq
└─ Support: BC-CP-CF-JBS
Version History & Updates
└─ What's New (2021-2025) → references/changelog.md设置与配置
├─ 初始设置前提条件 → references/setup-guide.md
├─ 创建服务实例
│ ├─ BTP控制台 → references/setup-guide.md#cockpit
│ ├─ CF CLI → references/setup-guide.md#cf-cli
│ └─ Kyma控制台 → references/setup-guide.md#kyma
└─ 配置XSUAA权限范围 → references/security.md
作业管理
├─ 创建作业 → references/rest-api.md#create-job
├─ 配置调度 → references/rest-api.md#schedules
├─ 运行日志与监控 → references/rest-api.md#run-logs
└─ 控制台操作 → references/operations.md#dashboard
调度配置
├─ 一次性vs周期性 → references/concepts.md#schedule-types
├─ Cron格式 → references/concepts.md#cron-format
├─ 日期/时间格式 → references/concepts.md#date-formats
└─ 自然语言格式 → references/concepts.md#human-readable
异步执行
├─ 异步模式流程 → references/concepts.md#async-mode
├─ 回调实现 → references/rest-api.md#update-run-log
└─ CF任务 → references/concepts.md#cf-tasks
安全与认证
├─ OAuth 2.0设置 → references/security.md#oauth
├─ XSUAA配置 → references/security.md#xsuaa
└─ 凭证轮换 → references/security.md#rotation
集成
├─ SAP Cloud ALM → references/integrations.md#cloud-alm
└─ 告警通知 → references/integrations.md#alert-notification
故障排查
├─ 常见错误 → references/troubleshooting.md#errors
├─ FAQ → references/troubleshooting.md#faq
└─ 支持组件:BC-CP-CF-JBS
版本历史与更新
└─ 新功能(2021-2025)→ references/changelog.mdCore Concepts
核心概念
Job
作业
A collection of schedules with an action endpoint. Jobs invoke a configured URL at specified times synchronously (short operations) or asynchronously (long processes).
包含多个调度与一个动作端点的集合。作业会在指定时间同步(短操作)或异步(长流程)调用配置的URL。
Schedule
调度
A one-time or recurring entity within a job. Supports multiple formats (cron, date/time, human-readable) and has three lifecycle states: SCHEDULED → RUNNING → COMPLETED.
作业内的一次性或周期性实体。支持多种格式(cron、日期/时间、自然语言),拥有三个生命周期状态:SCHEDULED → RUNNING → COMPLETED。
Action Endpoint
动作端点
An HTTP/REST endpoint exposed by your application that the service invokes when schedules trigger. Must be OAuth 2.0 protected in production.
应用暴露的HTTP/REST端点,服务会在调度触发时调用该端点。生产环境中必须通过OAuth 2.0保护。
Cloud Foundry Task
Cloud Foundry任务
An app or script that runs independently in its own container. Always executes asynchronously with configurable memory allocation.
在独立容器中运行的应用或脚本。始终以异步方式执行,可配置内存分配。
Service Constraints
服务约束
| Constraint | Value |
|---|---|
| Minimum schedule interval | 5 minutes |
| Synchronous request timeout | 15 seconds |
| Asynchronous timeout (default) | 30 minutes (configurable up to 7 days) |
| POST request body limit | 100 KB |
| Run log retention | 15 days |
| Service SLA | ~20 minutes from scheduled time |
| 约束项 | 取值 |
|---|---|
| 最小调度间隔 | 5分钟 |
| 同步请求超时 | 15秒 |
| 异步超时(默认) | 30分钟(可配置至最多7天) |
| POST请求体限制 | 100 KB |
| 运行日志保留时长 | 15天 |
| 服务SLA | 调度时间后约20分钟内执行 |
Quick Reference Tables
快速参考表
Schedule Formats
调度格式
| Format | Example | Use Case |
|---|---|---|
| Cron | | Every 30 min between 10:00-12:00 |
| Date/Time | | ISO-8601 one-time execution |
| Human-readable | | Natural language scheduling |
| repeatInterval | | Recurring at fixed intervals |
| repeatAt | | Daily at specific time |
| 格式 | 示例 | 使用场景 |
|---|---|---|
| Cron | | 10:00-12:00之间每30分钟执行一次 |
| 日期/时间 | | ISO-8601格式的一次性执行 |
| 自然语言 | | 自然语言调度 |
| repeatInterval | | 固定间隔周期性执行 |
| repeatAt | | 每日指定时间执行 |
Cron Format (7 fields)
Cron格式(7字段)
Year Month Day DayOfWeek Hour Minute Second
* * * * * * *| Field | Values | Special |
|---|---|---|
| Year | 4-digit (2025) | * = any |
| Month | 1-12 | */a = every a-th |
| Day | -31 to 31 | negative = from end |
| DayOfWeek | mon, tue, wed... | a.y = a-th occurrence |
| Hour | 0-23 | a:b = range |
| Minute | 0-59 | a:b/c = step in range |
| Second | 0-59 | a,b,c = multiple values |
Year Month Day DayOfWeek Hour Minute Second
* * * * * * *| 字段 | 取值范围 | 特殊符号 |
|---|---|---|
| Year | 4位数字(如2025) | * = 任意值 |
| Month | 1-12 | */a = 每a个单位执行一次 |
| Day | -31至31 | 负数 = 从月末倒数 |
| DayOfWeek | mon, tue, wed... | a.y = 第a次出现的周几 |
| Hour | 0-23 | a:b = 范围区间 |
| Minute | 0-59 | a:b/c = 区间内按步长执行 |
| Second | 0-59 | a,b,c = 多个取值 |
Schedule Lifecycle States
调度生命周期状态
| Phase | States | Description |
|---|---|---|
| SCHEDULED | SCHEDULED | Queued for future run |
| RUNNING | TRIGGERED, ACK_RECVD, ACK_NOT_RECVD | Executing |
| COMPLETED | SUCCESS, ERROR, REQUEST_ERROR, UNKNOWN | Finished |
| 阶段 | 状态 | 描述 |
|---|---|---|
| SCHEDULED | SCHEDULED | 已排队等待未来执行 |
| RUNNING | TRIGGERED, ACK_RECVD, ACK_NOT_RECVD | 执行中 |
| COMPLETED | SUCCESS, ERROR, REQUEST_ERROR, UNKNOWN | 已完成 |
HTTP Methods for Jobs
作业HTTP方法
| Method | Endpoint | Purpose |
|---|---|---|
| POST | | Create job |
| GET | | List all jobs |
| GET | | Get job details |
| PUT | | Update job |
| DELETE | | Delete job |
| 方法 | 端点 | 用途 |
|---|---|---|
| POST | | 创建作业 |
| GET | | 列出所有作业 |
| GET | | 获取作业详情 |
| PUT | | 更新作业 |
| DELETE | | 删除作业 |
Best Practices
最佳实践
Scheduling Optimization
调度优化
Avoid Peak Times:
- ❌ 0th or 30th second of any minute
- ❌ 0th, 30th, or multiples of 5 minutes
- ❌ Top of each hour
- ❌ Midnight UTC (busiest time)
Use Irregular Times:
- ✅ instead of
01:12:1701:00:00 - ✅ instead of
01:38:3701:30:00
避开峰值时段:
- ❌ 任何分钟的第0或30秒
- ❌ 第0、30分钟或5分钟倍数的时间点
- ❌ 每小时整点
- ❌ UTC午夜(最繁忙时段)
使用非规则时间:
- ✅ 使用而非
01:12:1701:00:00 - ✅ 使用而非
01:38:3701:30:00
Asynchronous Jobs
异步作业
- Return 202 Accepted immediately - Don't block the request
- Store request headers - ,
x-sap-job-id,x-sap-job-schedule-id,x-sap-job-run-idx-sap-scheduler-host - Update run log on completion - Single API call with final status
- Handle timeouts - Default 30 min, configurable up to 7 days
- 立即返回202 Accepted - 不要阻塞请求
- 存储请求头 - ,
x-sap-job-id,x-sap-job-schedule-id,x-sap-job-run-idx-sap-scheduler-host - 执行完成后更新运行日志 - 单次API调用提交最终状态
- 处理超时 - 默认30分钟,可配置至最多7天
One-Time Schedules
一次性调度
- Use only for testing/validation
- Auto-deactivate after execution
- Use for immediate execution
"time": "now"
- 仅用于测试/验证场景
- 执行后自动停用
- 使用实现立即执行
"time": "now"
Authentication Quick Start
认证快速入门
Standard Plan (OAuth 2.0)
标准方案(OAuth 2.0)
bash
undefinedbash
undefinedGet access token
获取访问令牌
curl -X POST "<uaa_url>/oauth/token"
-H "Authorization: Basic $(echo -n '<clientid>:<clientsecret>' | base64)"
-d "grant_type=client_credentials"
-H "Authorization: Basic $(echo -n '<clientid>:<clientsecret>' | base64)"
-d "grant_type=client_credentials"
curl -X POST "<uaa_url>/oauth/token"
-H "Authorization: Basic $(echo -n '<clientid>:<clientsecret>' | base64)"
-d "grant_type=client_credentials"
-H "Authorization: Basic $(echo -n '<clientid>:<clientsecret>' | base64)"
-d "grant_type=client_credentials"
Use token in API calls
在API调用中使用令牌
curl -X GET "https://jobscheduler-rest.<landscape>/scheduler/jobs"
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
undefinedcurl -X GET "https://jobscheduler-rest.<landscape>/scheduler/jobs"
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
undefinedxs-security.json Configuration
xs-security.json配置
json
{
"xsappname": "<app-name>",
"scopes": [{
"name": "$XSAPPNAME.JOBSCHEDULER",
"description": "Job Scheduler Scope",
"grant-as-authority-to-apps": ["$XSSERVICENAME(<jobscheduler-instance>)"]
}]
}json
{
"xsappname": "<app-name>",
"scopes": [{
"name": "$XSAPPNAME.JOBSCHEDULER",
"description": "Job Scheduler Scope",
"grant-as-authority-to-apps": ["$XSSERVICENAME(<jobscheduler-instance>)"]
}]
}Create Job Example
创建作业示例
json
POST /scheduler/jobs
{
"name": "myJob",
"description": "Process daily reports",
"action": "https://myapp.cfapps.eu10.hana.ondemand.com/api/process",
"active": true,
"httpMethod": "POST",
"schedules": [{
"active": true,
"description": "Daily at 6 AM",
"repeatAt": "6.00am",
"startTime": {"date": "2025-01-01", "format": "YYYY-MM-DD"}
}]
}json
POST /scheduler/jobs
{
"name": "myJob",
"description": "Process daily reports",
"action": "https://myapp.cfapps.eu10.hana.ondemand.com/api/process",
"active": true,
"httpMethod": "POST",
"schedules": [{
"active": true,
"description": "Daily at 6 AM",
"repeatAt": "6.00am",
"startTime": {"date": "2025-01-01", "format": "YYYY-MM-DD"}
}]
}Node.js Client Library
Node.js客户端库
Requirements: Node.js 14.x or later
bash
npm install @sap/jobs-client@1.8.6javascript
const JobSchedulerClient = require('@sap/jobs-client');
const scheduler = new JobSchedulerClient.Scheduler();
// Create job
scheduler.createJob({ url: vcapServices.jobscheduler[0].credentials.url }, {
name: 'myJob',
action: 'https://myapp.../process',
active: true,
httpMethod: 'GET',
schedules: [{ cron: '* * * * 0 0 0', active: true }]
}, (err, result) => { /* handle */ });要求:Node.js 14.x或更高版本
bash
npm install @sap/jobs-client@1.8.6javascript
const JobSchedulerClient = require('@sap/jobs-client');
const scheduler = new JobSchedulerClient.Scheduler();
// 创建作业
scheduler.createJob({ url: vcapServices.jobscheduler[0].credentials.url }, {
name: 'myJob',
action: 'https://myapp.../process',
active: true,
httpMethod: 'GET',
schedules: [{ cron: '* * * * 0 0 0', active: true }]
}, (err, result) => { /* 处理逻辑 */ });Rate Limits
速率限制
| Limit Type | Response Code | Header |
|---|---|---|
| Client limit exceeded | 429 | |
| Absolute limit exceeded | 503 | |
Limits stack - both can apply simultaneously.
| 限制类型 | 响应码 | 响应头 |
|---|---|---|
| 客户端限制超出 | 429 | |
| 绝对限制超出 | 503 | |
限制会叠加 - 两种限制可能同时生效。
Service Behavior
服务行为
Outage Recovery
中断恢复
| Outage Duration | Behavior |
|---|---|
| < 20 minutes | All missed executions run immediately |
| >= 20 minutes | Only last missed execution runs |
| 中断时长 | 行为 |
|---|---|
| < 20分钟 | 所有错过的执行立即运行 |
| >= 20分钟 | 仅运行最后一次错过的执行 |
Auto-Deactivation Triggers
自动停用触发条件
- One-time schedule executed
- No valid future dates exist
- Job/schedule endTime reached
- Action endpoint unreachable for 10+ days
- 一次性调度已执行
- 无有效未来执行日期
- 作业/调度的endTime已到达
- 动作端点连续10天以上无法访问
Reference Files
参考文件
Detailed Guides Available
可用详细指南
- references/concepts.md - Schedule types, formats, lifecycle, async mode, multitenancy
- references/rest-api.md - Complete REST API reference with all endpoints
- references/setup-guide.md - Prerequisites, service instance creation
- references/security.md - OAuth 2.0, XSUAA scopes, credential rotation
- references/integrations.md - Cloud ALM, Alert Notification Service
- references/troubleshooting.md - FAQ, error scenarios, monitoring
- references/operations.md - Dashboard, backup/restore, service behavior
- references/changelog.md - Version history, feature updates (2021-2025)
- references/concepts.md - 调度类型、格式、生命周期、异步模式、多租户
- references/rest-api.md - 完整REST API参考,包含所有端点
- references/setup-guide.md - 前提条件、服务实例创建
- references/security.md - OAuth 2.0、XSUAA权限范围、凭证轮换
- references/integrations.md - Cloud ALM、Alert Notification Service集成
- references/troubleshooting.md - FAQ、错误场景、监控
- references/operations.md - 控制台、备份/恢复、服务行为
- references/changelog.md - 版本历史、功能更新(2021-2025)
Templates Available
可用模板
- templates/job-creation.json - Job creation request template
- templates/xs-security.json - XSUAA configuration template
- templates/job-creation.json - 作业创建请求模板
- templates/xs-security.json - XSUAA配置模板
Common Pitfalls
常见陷阱
Setup:
- ❌ Missing XSUAA binding before Job Scheduling binding
- ❌ Not granting scopes via
grant-as-authority-to-apps - ❌ Using HTTP instead of HTTPS for action endpoints
Scheduling:
- ❌ Using Linux cron format (service uses SAP cron)
- ❌ Scheduling at peak times (00:00, 00:30, etc.)
- ❌ Forgetting UTC timezone (only supported timezone)
Async Jobs:
- ❌ Not returning 202 Accepted immediately
- ❌ Forgetting to call Update Run Log API
- ❌ Multiple status updates instead of single final update
Multitenancy:
- ❌ Using filter with SaaS tenant tokens (returns 400)
tenantId - ❌ Missing Job Scheduling as application dependency
设置阶段:
- ❌ 在绑定Job Scheduling之前未绑定XSUAA
- ❌ 未通过授予权限范围
grant-as-authority-to-apps - ❌ 动作端点使用HTTP而非HTTPS
调度阶段:
- ❌ 使用Linux cron格式(服务使用SAP cron格式)
- ❌ 在峰值时段调度(如00:00、00:30等)
- ❌ 忘记使用UTC时区(仅支持该时区)
异步作业:
- ❌ 未立即返回202 Accepted
- ❌ 忘记调用更新运行日志API
- ❌ 多次更新状态而非单次提交最终状态
多租户场景:
- ❌ 使用SaaS租户令牌时添加筛选器(会返回400错误)
tenantId - ❌ 未将Job Scheduling列为应用依赖
External Resources
外部资源
SAP Documentation
SAP文档
- SAP Help Portal: https://help.sap.com/docs/job-scheduling
- SAP Developer Center: https://developers.sap.com/
- SAP帮助门户:https://help.sap.com/docs/job-scheduling
- SAP开发者中心:https://developers.sap.com/
Support
支持
- Component: BC-CP-CF-JBS
- SAP Trust Center: Platform status verification
- Guided Answers: Self-service troubleshooting
- 组件:BC-CP-CF-JBS
- SAP信任中心:平台状态验证
- 引导式答案:自助故障排查
Updates and Maintenance
更新与维护
Source: SAP BTP Job Scheduling Service Documentation
To Update This Skill:
- Check GitHub repository for documentation updates
- Review What's New section for changes
- Update affected reference files
- Update templates if configurations changed
- Update "Last Verified" date
Quarterly Review Recommended: Check for updates every 3 months
Next Review: 2026-02-27
来源:SAP BTP Job Scheduling Service文档
更新本技能步骤:
- 检查GitHub仓库获取文档更新
- 查看“新功能”部分了解变更
- 更新受影响的参考文件
- 若配置变更则更新模板
- 更新“最后验证时间”
建议季度审核:每3个月检查一次更新
下次审核时间:2026-02-27
Bundled Resources
捆绑资源
Reference Files
参考文件
- references/concepts.md - Schedule types, formats, lifecycle, async mode, multitenancy (12K lines)
- references/rest-api.md - Complete REST API reference with all endpoints (20K lines)
- references/setup-guide.md - Prerequisites, service instance creation (9K lines)
- references/security.md - OAuth 2.0, XSUAA scopes, credential rotation (11K lines)
- references/integrations.md - Cloud ALM, Alert Notification Service (8K lines)
- references/troubleshooting.md - FAQ, error scenarios, monitoring (9K lines)
- references/operations.md - Dashboard, backup/restore, service behavior (8K lines)
- references/changelog.md - Version history, feature updates (2021-2025) (9K lines)
- references/concepts.md - 调度类型、格式、生命周期、异步模式、多租户(12000行)
- references/rest-api.md - 完整REST API参考,包含所有端点(20000行)
- references/setup-guide.md - 前提条件、服务实例创建(9000行)
- references/security.md - OAuth 2.0、XSUAA权限范围、凭证轮换(11000行)
- references/integrations.md - Cloud ALM、Alert Notification Service集成(8000行)
- references/troubleshooting.md - FAQ、错误场景、监控(9000行)
- references/operations.md - 控制台、备份/恢复、服务行为(8000行)
- references/changelog.md - 版本历史、功能更新(2021-2025)(9000行)
Templates
模板
- templates/job-creation.json - Job creation request template with examples
- templates/xs-security.json - XSUAA configuration template for OAuth scopes
License: GPL-3.0
Maintainer: Eduard Jiglau | hello@sap-ai-skills.com | sap-ai-skills.com | https://github.com/secondsky/sap-skills
- templates/job-creation.json - 带示例的作业创建请求模板
- templates/xs-security.json - OAuth权限范围的XSUAA配置模板
许可证:GPL-3.0
维护者:Eduard Jiglau | hello@sap-ai-skills.com | sap-ai-skills.com | https://github.com/secondsky/sap-skills