Skip to main content

REST API

vNext platformu üç ana endpoint grubu sunar: Definition, Function, Instance.

Base URL örneği: http://localhost:4201 (default offset) OpenAPI versiyon: 3.0.4

Definition Endpoints

POST /api/v1/definitions/publish

Component (workflow, task, function, schema, view, extension) deploy etmek için kullanılır.

Request body: PublishInput

FieldTypeRequiredDescription
keystringComponent anahtarı
flowstringFlow ismi
domainstringOwning domain
versionstringComponent versiyonu (SemVer)
flowVersionstringFlow versiyonu
tagsstring[]Etiketler
attributesobjectComponent definition payload
dataPublishDataInput[]Master data publish (opsiyonel)

Response: 200 OK.


Function Endpoints

GET /api/v1/{domain}/functions

Belirtilen domain'de tanımlı tüm function'ları döner.

ParameterInDescription
domainpathDomain adı

GET /api/v1/{domain}/functions/{function}

İlgili function'ı çalıştırır (workflow bağımsız).

ParameterInDescription
domainpathDomain adı
functionpathFunction key
versionqueryFunction versiyonu (opsiyonel; varsayılan: latest)

GET /api/v1/{domain}/workflows/{workflow}/instances/{instance}/functions/{function}

Function'ı instance context'inde çalıştırır.

ParameterInDescription
domainpathDomain adı
workflowpathWorkflow key
instancepathInstance ID
functionpathFunction key
VersionqueryFunction versiyonu
ExtensionsqueryÇalıştırılacak extension key listesi
TransitionKeyqueryİlgili transition (varsa)
RolequeryAuthorization rolü
FunctionKeyqueryInner function reference
QueryRolesqueryQuery roles dahil edilsin mi (boolean)
If-None-MatchheaderETag (304 Not Modified için)

Instance Endpoints

POST /api/v1/{domain}/workflows/{workflow}/instances/start

Yeni instance başlatır.

Query parameters:

  • version — workflow versiyonu (opsiyonel)
  • synctrue/false (default false); bkz. Async / Sync
  • extensions — extension key listesi (response'a dahil edilir)

Request body: CreateInstanceDto

FieldTypeDescription
keystringInstance key (max 100 char)
tagsstring[]Etiketler
attributesobjectInitial instance data
stagestring | nullKullanıcı tanımlı durum bilgisi (max 120 char, serbest metin)

Responses:

  • 200 OKStartInstanceOutput (id, key, status, attributes, eTag, extensions)
  • 400 Bad RequestProblemDetails
  • 404 Not Found → workflow bulunamadı
  • 409 Conflict → key collision

PATCH /api/v1/{domain}/workflows/{workflow}/instances/{instance}/transitions/{transitionKey}

Bir instance üzerinde transition tetikler.

Query parameters: sync, extensions

Request body: TransitionDataInput

FieldTypeDescription
keystringTransition idempotency key
tagsstring[]Etiketler
attributesobjectTransition payload data
stagestring | nullKullanıcı tanımlı durum bilgisi (max 120 char, serbest metin)

Responses:

  • 200 OKTransitionOutput
  • 400 Bad Request, 403 Forbidden (yetki yok), 404 Not Found, 409 Conflict, 503 Service Unavailable

POST /api/v1/{domain}/workflows/{workflow}/instances/{instance}/retry

Faulted instance'ı yeniden çalıştırır.

Query parameters: sync

Request body: TransitionDataInput

Responses:

  • 200 OKRetryInstanceOutput (id, status, retriedTransitionId)
  • 400, 404ProblemDetails

GET /api/v1/{domain}/workflows/{workflow}/instances/{instance}

Instance metadata + data döner (extension dahil).

Query parameters: extensions, version Headers: If-None-Match (ETag)

Responses:

  • 200 OKGetInstanceOutput
  • 304 Not Modified → ETag eşleşti
  • 404 Not Found

GET /api/v1/{domain}/workflows/{workflow}/instances

İlgili workflow'dan üretilen instance'ları filtreler ve sıralar (extension dahil değildir).

Query parameters:

  • filter — JSONPath benzeri filter syntax (bkz. Instance Filtering)
  • extensions — extension key listesi
  • page (1-1000), pageSize (1-100), sort, orderBy, version

GET /api/v1/{domain}/workflows/{workflow}/instances/{instance}/transitions

Instance'ın transition history'sini döner.


Common DTOs

CreateInstanceDto

{
key?: string; // max 100 chars
tags?: string[];
attributes?: any;
stage?: string; // max 120 chars, kullanıcı tanımlı durum bilgisi
}

GetInstanceOutput

{
id?: string; // uuid
key?: string;
flow?: string;
domain?: string;
flowVersion?: string;
eTag?: string;
entityEtag?: string;
tags?: string[];
metadata?: InstanceMetadataDto;
attributes?: any;
extensions?: { [key: string]: any };
}

InstanceMetadataDto

{
currentState?: string;
effectiveState?: string;
status?: InstanceStatus;
effectiveStateType?: StateType; // initial|intermediate|finish|subFlow|wizard
effectiveStateSubType?: StateSubType; // none|success|error|terminated|suspended|busy|human|cancelled|timeout
completedAt?: string; // ISO datetime
duration?: number;
createdAt: string;
modifiedAt?: string;
createdBy?: string;
createdByBehalfOf?: string;
modifiedBy?: string;
modifiedByBehalfOf?: string;
stage?: string; // max 120 chars, kullanıcı tanımlı durum bilgisi
}

StartInstanceOutput / TransitionOutput

{
id: string;
key?: string;
status: InstanceStatus;
attributes?: any;
eTag?: string;
entityEtag?: string;
extensions?: { [key: string]: any };
}

RetryInstanceOutput

{
id: string;
status: InstanceStatus;
retriedTransitionId: string;
}

TransitionDataInput

{
key?: string;
tags?: string[];
attributes?: any;
stage?: string; // max 120 chars, kullanıcı tanımlı durum bilgisi
}

PublishInput

{
key: string; // max 100 chars, [a-zA-Z0-9-]
flow: string; // max 100 chars
domain: string; // max 50 chars, [a-zA-Z-]
version: string; // max 180 chars
flowVersion: string;
tags?: string[];
attributes: any;
data?: PublishDataInput[];
}

ProblemDetails (RFC 7807)

{
type?: string;
title?: string;
status?: number;
detail?: string;
instance?: string;
}

ETag (Concurrent Update Control)

Instance read response'larında eTag ve entityEtag döner. Update isteği için If-None-Match (read-after) veya If-Match (update concurrency) header'ı kullanılabilir. Bkz. Core Principles → ETag.

Domain Filtreleme + URL Templates

API endpoint URL'leri Url Templates konfigürasyonu ile özelleştirilebilir (HEOTAS pattern, API gateway uyumu için).

İlgili