Getting Started
Temporal is an open source durable execution platform for building and running reliable, fault-tolerant applications. It handles retries, timeouts, state persistence, and failure recovery automatically, so you can write distributed workflows as ordinary code. Available as an open web service in Eyevinn Open Source Cloud, Temporal is ideal for long-running business processes, data pipelines, order management systems, and any workflow where partial failure must be handled correctly. This tutorial walks you through the steps to get started.
Prerequisites
- If you have not already done so, sign up for an Eyevinn OSC account
Step 1: Create a PostgreSQL database
Temporal requires a PostgreSQL database to persist workflow execution state, history, and metadata. Navigate to the PostgreSQL service in the Eyevinn OSC web console. Click Create psql-db and enter a name and password for the instance.
Based on the IP and port shown after creation, the connection URL for your database is:
postgres://postgres:<password>@<IP>:<PORT>/postgres
Step 2: Store the connection URL as a secret
Navigate to the Temporal service in the Eyevinn OSC web console. Go to the Service Secrets tab and click New Secret.
Create a secret named dburl and paste the PostgreSQL connection URL from Step 1 as the value.
Step 3: Create the Temporal instance
Go to the My temporals tab and click Create temporal. Fill in:
- Name: a short alphanumeric name for your instance
- DatabaseUrl:
{{secrets.dburl}}
Click the instance card once the status turns green and running. The instance URL is the address of the Temporal Web UI where you can monitor workflow executions.
Step 4: Open the Temporal Web UI
Open the instance URL in your browser. The Temporal Web UI requires no login credentials by default. From the UI you can:
- Browse namespaces and workflow executions
- Inspect workflow history and event timelines
- Search for workflows by status, type, or time range
- Terminate or reset stuck workflows
Step 5: Connect your application
Install the Temporal SDK for your language and point it at your OSC instance.
Node.js (TypeScript/JavaScript):
import { Client, Connection } from '@temporalio/client';
const connection = await Connection.connect({
address: '<your-instance-hostname>:7233',
});
const client = new Client({ connection });
const handle = await client.workflow.start('myWorkflow', {
taskQueue: 'my-task-queue',
workflowId: 'my-workflow-001',
args: ['hello'],
});
console.log(`Workflow started: ${handle.workflowId}`);
const result = await handle.result();
console.log('Result:', result);
Python:
from temporalio.client import Client
async def main():
client = await Client.connect("<your-instance-hostname>:7233")
result = await client.execute_workflow(
"MyWorkflow",
"hello",
id="my-workflow-001",
task_queue="my-task-queue",
)
print(f"Result: {result}")
Replace <your-instance-hostname> with the hostname part of your Temporal instance URL.
Using the CLI
You can create a Temporal instance using the OSC CLI:
# First create a PostgreSQL database
osc create birme-osc-postgresql mytemporaldb -o PostgresPassword="mypassword"
# Create the Temporal instance
osc create temporalio-temporal mytemporal \
-o DatabaseUrl="postgres://postgres:mypassword@<IP>:<PORT>/postgres"