# st.doForSkills

This action allows you to endorse each skill provided by the parent action, or only the skills whose names match the patterns you specify.

> Skill names are shown as the profile owner entered them, in the owner's language, whatever your own LinkedIn language. A German profile lists `Projektmanagement`, not `Project Management`. Write patterns in the language of the profiles you target, or cover several languages in one pattern, such as `"proje[ck]t\\s*management"`.

## Constraints

> ⏺️ **Root Start:** not allowed.

> ⬆️ **Parent Actions:** [st.retrievePersonSkills](/docs/action-st-retrieve-person-skills).

> ⬇️ **Child Actions:** [st.endorsePersonSkill](/docs/action-st-endorse-person-skill).

## Parameters

```json
{
  "actionType": "st.doForSkills",
  "skillNamePatterns": ["business", "project\\s*manage", "^(agile|scrum)$"],
  "then": {
    "actionType": "st.endorsePersonSkill"
  }
}
```

- `skillNamePatterns` (optional) – array of regular expressions that select skills by name. A skill is selected when **any** of the patterns matches its name. If omitted, every skill is selected.
  - The syntax is [RE2](https://github.com/google/re2/wiki/Syntax), the dialect of Go `regexp` and Google Sheets `REGEXMATCH`. Ordinary patterns read like JavaScript regular expressions, but lookaround (`(?=…)`, `(?!…)`, `(?<=…)`, `(?<!…)`) and backreferences (`\1`) are not supported.
  - Matching is case-insensitive and searches anywhere in the name: `manage` matches `Project Management`. To require the whole name to match, anchor the pattern with `^…$`: `^scrum$` matches `Scrum` but not `Scrum Master`.
  - Patterns are JSON strings, so each backslash is written twice: `"project\\s*manage"` is the regular expression `project\s*manage`.
  - The array holds 1 to 20 patterns, each 1 to 200 characters long. An empty array, more than 20 patterns, an empty pattern, a pattern longer than 200 characters, or a pattern that is not valid RE2 (including lookaround, backreferences and repetition counts above 1000) is rejected with `invalidWorkflow` before the workflow starts.
  - The patterns together must also stay within a matching-cost budget: their compiled RE2 programs may hold at most 5000 instructions in total. Ordinary patterns are far below it – 20 alternations of 200 characters each come to about 3700. Large repetition counts are what spend it: `.{0,1000}` alone costs about 2000, so three of them across the array exceed the budget and the workflow is rejected with `invalidWorkflow`.
- `then` (required) – exactly one [st.endorsePersonSkill](/docs/action-st-endorse-person-skill) action without `skillName`, as an object or a one-element array. The skill to endorse comes from the iteration.

## Result options

This action doesn't produce its own distinct result. Its effects are visible in the skills returned by [st.retrievePersonSkills](/docs/action-st-retrieve-person-skills):

- The parent's `data` still lists every skill of the person.
- A selected skill carries a `then` field: an array with the result of its [st.endorsePersonSkill](/docs/action-st-endorse-person-skill), successful or failed.
- A skill the patterns did not select has no `then` field.

Selected skills are endorsed one at a time, in the order they appear on the profile. A failed endorsement is reported in that skill's `then`, and the next selected skill is still processed. Each successful endorsement counts toward the `stEndorsements` [limit](/docs/admin-limits#endorsement-limits): once the limit is reached, the remaining selected skills get `limitExceeded` in their `then` and are not endorsed. If the person is not your 1st-degree connection, every selected skill gets `connectionNotFound` and nothing is endorsed.

## Usage examples

1. **Endorsing only skills related to business and project management:**

**Workflow:**

```json
{
  "actionType": "st.openPersonPage",
  "personUrl": "https://www.linkedin.com/in/person1",
  "basicInfo": false,
  "then": {
    "actionType": "st.retrievePersonSkills",
    "then": {
      "actionType": "st.doForSkills",
      "skillNamePatterns": ["business", "project\\s*manage", "^(agile|scrum)$"],
      "then": {
        "actionType": "st.endorsePersonSkill"
      }
    }
  }
}
```

**Completion:**

```json
{
  "actionType": "st.openPersonPage",
  "success": true,
  "data": {
    "then": {
      "actionType": "st.retrievePersonSkills",
      "success": true,
      "data": [
        {
          "name": "Business Strategy",
          "then": [
            {
              "actionType": "st.endorsePersonSkill",
              "success": true
            }
          ]
        },
        {
          "name": "Python"
        },
        {
          "name": "Project Management",
          "then": [
            {
              "actionType": "st.endorsePersonSkill",
              "success": true
            }
          ]
        },
        {
          "name": "Agile Coaching"
        },
        {
          "name": "Scrum",
          "then": [
            {
              "actionType": "st.endorsePersonSkill",
              "success": false,
              "error": {
                "type": "limitExceeded",
                "message": "The configured limit for this action category has been exceeded."
              }
            }
          ]
        }
      ]
    }
  }
}
```

`Python` matches none of the patterns. `Agile Coaching` is not selected either, because `^(agile|scrum)$` must match the whole name. `Scrum` was selected, but the account had reached its endorsement limit by then, so it was not endorsed.

2. **Endorsing every skill of a person:**

**Workflow:**

```json
{
  "actionType": "st.openPersonPage",
  "personUrl": "https://www.linkedin.com/in/person1",
  "basicInfo": false,
  "then": {
    "actionType": "st.retrievePersonSkills",
    "then": {
      "actionType": "st.doForSkills",
      "then": {
        "actionType": "st.endorsePersonSkill"
      }
    }
  }
}
```

**Completion:**

```json
{
  "actionType": "st.openPersonPage",
  "success": true,
  "data": {
    "then": {
      "actionType": "st.retrievePersonSkills",
      "success": true,
      "data": [
        {
          "name": "Business Strategy",
          "then": [
            {
              "actionType": "st.endorsePersonSkill",
              "success": true
            }
          ]
        },
        {
          "name": "Python",
          "then": [
            {
              "actionType": "st.endorsePersonSkill",
              "success": true
            }
          ]
        }
      ]
    }
  }
}
```
