# Start a workflow execution as a new session or a new attempt of an existing session

"resume" is used to rerun an attempt. It is used in the case an attempt failed then users want to resume it from the middle.It has two modes "failed" or "from" to set the way to resume.In "failed" mode, the attempt specified by "attemptId" is resumed from the failed tasks.In "from" mode, the attempt is resumed from the task which is set in "from" field.

Endpoint: PUT /api/attempts
Version: 1.0
Security: ApiKeyAuth

## Request fields (application/json):

  - `allowQueueing` (boolean)
    Whether an attempt can be queued when the maximum attempt limit is reached.

  - `params` (object, required)
    parameters as json
    Example: {"key1":12345}

  - `projectName` (string)
    project name. workflowId or (projectName and workflowName) are required
    Example: "project-a"

  - `resume` (object) — one of (discriminator: mode):
    Configuration to resume an attempt. {"mode": "failed", "attemptId": "12345"} or {"mode": "from", "attemptId": "12345", "from": "+t1"}
    - failed:
      - `attemptId` (string, required)
        attemptId
        Example: "12345"
    - from:
      - `attemptId` (string, required)
        attemptId
        Example: "12345"
      - `from` (string, required)
        the task name to resume

  - `resume.mode` (string, required)
    mode: "from" or "failed"
    Enum: "from", "failed"

  - `retryAttemptName` (string)
    unique attempt name for retry

  - `sessionTime` (string, required)
    session time
    Example: "2023-08-17T18:56:24+09:00"

  - `workflowId` (string)
    workflow ID. workflowId or (projectName and workflowName) are required
    Example: "123456"

  - `workflowName` (string)
    workflow name. workflowId or (projectName and workflowName) are required
    Example: "workflow-a"

## Response 200 fields (application/json):

  - `cancelRequested` (boolean, required)
    true if kill requested

  - `createdAt` (string, required)
    created time
    Example: "2023-08-18T06:52:33Z"

  - `done` (boolean, required)
    true if the attempt finished

  - `finishedAt` (string)
    finished time
    Example: "2023-08-18T06:52:33Z"

  - `id` (string, required)
    attempt ID
    Example: "123456"

  - `index` (integer, required)
    index for multiple attempts
    Example: 1

  - `params` (object, required)
    passed parameters as JSON

  - `poolId` (string)
    ID of the pool to which this attempt is assigned.
    Example: "42"

  - `project` (object, required)
    Name and ID

  - `project.id` (string, required)
    ID
    Example: "123456"

  - `project.name` (string, required)
    name
    Example: "abcdefg"

  - `retryAttemptName` (string, required)
    attempt name for retry
    Example: "retry-12345"

  - `sessionId` (string, required)
    session ID
    Example: "123456"

  - `sessionTime` (string, required)
    session time
    Example: "2022-12-31T23:59:00+00:00"

  - `sessionUuid` (string, required)
    unique UUID of this session
    Example: "2b91a014-076e-4c6d-8b51-f4f91089cab2"

  - `status` (string, required)
    The current status of the attempt.
    Enum: "blocked", "queued", "running", "canceling", "success", "error", "killed"

  - `success` (boolean, required)
    true if the attempt finished successfully

  - `workflow` (object, required)
    Name and optional ID

  - `workflow.id` (string)
    ID
    Example: "123456"

  - `workflow.name` (string, required)
    name
    Example: "abcdefg"


