https://github.com/inngest/inngest-kt
Kotlin/Java SDK for Inngest
https://github.com/inngest/inngest-kt
durable-execution inngest java kotlin queues workflow-engine workflows
Last synced: 5 months ago
JSON representation
Kotlin/Java SDK for Inngest
- Host: GitHub
- URL: https://github.com/inngest/inngest-kt
- Owner: inngest
- License: apache-2.0
- Created: 2023-10-31T21:29:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-31T17:37:33.000Z (12 months ago)
- Last Synced: 2025-06-11T05:16:32.371Z (7 months ago)
- Topics: durable-execution, inngest, java, kotlin, queues, workflow-engine, workflows
- Language: Kotlin
- Homepage: https://www.inngest.com
- Size: 369 KB
- Stars: 5
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Inngest Kotlin SDK
[](https://central.sonatype.com/artifact/com.inngest/inngest)
[](https://central.sonatype.com/artifact/com.inngest/inngest-spring-boot-adapter)
[](https://www.inngest.com/discord)
[Inngest](https://www.inngest.com) SDK for Kotlin with Java interoperability.
## Defining a function
Kotlin
```kotlin
class TranscodeVideo : InngestFunction() {
override fun config(builder: InngestFunctionConfigBuilder): InngestFunctionConfigBuilder =
builder
.id("process-video")
.name("Process video upload")
.triggerEvent("media/video.uploaded")
.retries(2)
.concurrency(10)
override fun execute(
ctx: FunctionContext,
step: Step,
): HashMap {
val transcription =
step.run("transcribe-video") {
// Download video, run through transcription model, return output
"Hi there, My name is Jamie..." // dummy example content
}
val summary =
step.run("summarize") {
// Send t
"Hi there, My name is Jamie..." // dummy example content
}
step.run("save-results") {
// Save summary, to your database
// database.save(event.data["videoId"], transcription, summary)
}
return hashMapOf("restored" to false)
}
}
```
Java (Coming soon)
## Creating functions
Define your function's configuration using the `config` method and the `InngestFunctionConfigBuilder` class.
The `config` method must be overridden and an `id` is required. All options should are discoverable via
the builder class passed as the only argument to the `config` method.
Kotlin
```kotlin
import java.time.Duration
class TranscodeVideo : InngestFunction() {
override fun config(builder: InngestFunctionConfigBuilder): InngestFunctionConfigBuilder =
builder
.id("process-video")
.name("Process video upload")
.triggerEvent("media/video.uploaded")
.retries(2)
.batchEvents(50, Duration.ofSeconds(30))
.concurrency(10)
}
```
## Sending events (_triggering functions_)
Kotlin
```kotlin
import java.time.Duration
class TranscodeVideo : InngestFunction() {
override fun config(builder: InngestFunctionConfigBuilder): InngestFunctionConfigBuilder =
builder
.id("process-video")
.name("Process video upload")
.triggerEvent("media/video.uploaded")
.batchEvents(50, Duration.ofSeconds(30))
.concurrency(10)
}
```
## Contributing
[See the contributing guide for more information](./CONTRIBUTING.md)